Load Libraries

suppressMessages(library(minfi))
suppressMessages(library(reshape))
suppressMessages(library(ggplot2))
suppressMessages(library(gridExtra))
suppressMessages(library(RColorBrewer))
suppressMessages(library(here))
suppressMessages(library(binom))
suppressMessages(library(limma))

options(stringsAsFactors = FALSE)

Load Functions

source(here("scripts","00_pretty_plots.R"))
suppressMessages(source(here("scripts","00_heat_scree_plot_generic.R")))
source(here("scripts","00_EM_array_uniform_background_maximise_betabinom.R"))

Download Data

# wget https://www.ebi.ac.uk/arrayexpress/files/E-MTAB-4957/E-MTAB-4957.raw.1.zip
# wget https://www.ebi.ac.uk/arrayexpress/files/E-MTAB-4957/E-MTAB-4957.raw.2.zip
# wget https://www.ebi.ac.uk/arrayexpress/files/E-MTAB-4957/E-MTAB-4957.raw.3.zip
# wget https://www.ebi.ac.uk/arrayexpress/files/E-MTAB-4957/E-MTAB-4957.raw.4.zip
# wget https://www.ebi.ac.uk/arrayexpress/files/E-MTAB-4957/E-MTAB-4957.raw.5.zip
# unzip E-MTAB-4957.raw.1.zip 
# unzip E-MTAB-4957.raw.2.zip 
# unzip E-MTAB-4957.raw.3.zip 
# unzip E-MTAB-4957.raw.4.zip 
# unzip E-MTAB-4957.raw.5.zip 

#wget https://www.ebi.ac.uk/arrayexpress/files/E-MTAB-4957/E-MTAB-4957.sdrf.txt
path<-"data/published_organoids/E_MTAB_4957"

sampleinfo_organoid <- read.table(here(path, "E-MTAB-4957.sdrf.txt"), header=T, sep="\t")
sampleinfo_organoid<-sampleinfo_organoid[,c(1:15,30:34,38:41)]

#sample info cleanup
sampleinfo_organoid$sentrix<-sapply(1:nrow(sampleinfo_organoid), function(x) strsplit(as.character(sampleinfo_organoid$Assay.Name)[x], "_")[[1]][1])

sampleinfo_organoid$array.id.path <- file.path(here(path), sampleinfo_organoid$Assay.Name)
rgset_organoid <- read.metharray(sampleinfo_organoid$array.id.path, verbose = FALSE)

Normalize DNAm Arrays

# Background and dye bias correction with noob thhrough funnorm implemented in minfi
#http://bioconductor.org/help/course-materials/2015/BioC2015/methylation450k.html
MSet.illumina <- preprocessFunnorm(rgset_organoid)
## [preprocessFunnorm] Background and dye bias correction with noob
## Loading required package: IlluminaHumanMethylation450kmanifest
## Loading required package: IlluminaHumanMethylation450kanno.ilmn12.hg19
## [preprocessFunnorm] Mapping to genome
## [preprocessFunnorm] Quantile extraction
## [preprocessFunnorm] Normalization
MTAB_organoid_beta<-getBeta(MSet.illumina)

Detection p values across all probes for each sample

avg_detPval <- colMeans(detectionP(rgset_organoid))
sampleinfo_organoid$det_pval<-avg_detPval

print("detection pval")
## [1] "detection pval"
ggplot(sampleinfo_organoid)+geom_boxplot(aes(as.factor(sentrix), det_pval, fill=as.factor(sentrix)), outlier.shape = NA)+
  geom_point(aes(as.factor(sentrix), det_pval, group=Assay.Name, fill=as.factor(sentrix)), shape=21, color="black",
             position = position_jitter(w = 0.25))+theme_bw()+theme(axis.text.x=element_text(angle = 45, vjust = 1, hjust=1))+
  xlab("Sentrix ID")+ylab("Mean Detection P Value")+guides(fill=FALSE)+ylim(0,0.008)

ggsave(here("figs","MTAB4957_detection_pvalue.pdf"), width=6, height=5)
ggsave(here("figs/jpeg","MTAB4957_detection_pvalue.jpeg"), width=6, height=5)

Beta distribution before and after normalization

beta_raw<-getBeta(rgset_organoid)
betas<-getBeta(MSet.illumina)

Beta_melted<- melt(betas)
Beta_melted_raw<- melt(beta_raw)

#remove NAs before plotting (otherwise get many non-inifnite warnings)
Beta_Plot<-Beta_melted[which(!(is.na(Beta_melted$value))),]
Beta_Plot_raw<-Beta_melted_raw[which(!(is.na(Beta_melted_raw$value))),]

#add meta
colnames(Beta_Plot)<-c("CpG","ID","Beta")
Beta_Plot<-merge(Beta_Plot,sampleinfo_organoid, by.x="ID", by.y="Assay.Name")
colnames(Beta_Plot_raw)<-c("CpG","ID","Beta")
Beta_Plot_raw<-merge(Beta_Plot_raw,sampleinfo_organoid, by.x="ID", by.y="Assay.Name")

dis1<-ggplot(Beta_Plot, aes(Beta, group=as.character(ID), color=as.character(Characteristics.sampling.site.)))+
  geom_density()+theme_bw()+xlab("DNAm Beta Value")

dis2<-ggplot(Beta_Plot_raw, aes(Beta, group=as.character(ID), color=as.character(Characteristics.sampling.site.)))+
  geom_density()+theme_bw()+xlab("DNAm Beta Value")

ggsave(here("figs","MTAB4957_beta_distribution.pdf"), grid.arrange(dis1, dis2),w=20, h=5)
ggsave(here("figs/jpeg","MTAB4957_beta_distribution.jpeg"), grid.arrange(dis1, dis2), w=20, h=5)

Probe Filtering

MTAB_organoid_beta <- MTAB_organoid_beta[!grepl("rs",rownames(MTAB_organoid_beta)), ]
print(paste("Samples available: ",ncol(MTAB_organoid_beta),"\nProbes available: ",nrow(MTAB_organoid_beta),sep=""))
## [1] "Samples available: 134\nProbes available: 485512"

450K annotation from illumina

# https://emea.support.illumina.com/downloads/humanmethylation450_15017482_v1-2_product_files.html
anno_450k<-read.csv(here("data","HumanMethylation450_15017482_v1-2.csv"), skip=7)
anno_450k<-anno_450k[match(rownames(MTAB_organoid_beta),anno_450k$IlmnID),]
identical(rownames(MTAB_organoid_beta), anno_450k$IlmnID)
## [1] TRUE

Sex Chromosomes

MTAB_organoid_beta<-MTAB_organoid_beta[which(!(anno_450k$CHR%in%c('X','Y'))),] 
filt_sex<-nrow(MTAB_organoid_beta)
print(paste("Samples available: ",ncol(MTAB_organoid_beta),"Probes available: ",nrow(MTAB_organoid_beta),sep=""))
## [1] "Samples available: 134Probes available: 473864"

Cross-hybridizing probes and polymorphic probes.

Some probes have been found to cross-hybridize with other chromosomes (Price et al. 2013 Epigenetics). https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GPL16304

price<-read.table(here("data","GPL16304-47833.txt"), sep='\t', header=T, skip=22)
price<-price[match(rownames(MTAB_organoid_beta),price$ID),]

cross_hyb<-price[which(price$XY_Hits=="XY_YES" | price$Autosomal_Hits=="A_YES"),]
MTAB_organoid_beta<-MTAB_organoid_beta[which(!(rownames(MTAB_organoid_beta)%in%cross_hyb$ID)),]
filt_cross<-nrow(MTAB_organoid_beta)
print(paste("Samples available: ",ncol(MTAB_organoid_beta),"\nProbes available: ",nrow(MTAB_organoid_beta),sep=""))
## [1] "Samples available: 134\nProbes available: 433274"

Polymorphic probes

SnpatCpG<-price[which(price$Target.CpG.SNP!=""),]
MTAB_organoid_beta<-MTAB_organoid_beta[which(!(rownames(MTAB_organoid_beta)%in%SnpatCpG$ID)),]
filt_poly<-nrow(MTAB_organoid_beta)
print(paste("Samples available: ",ncol(MTAB_organoid_beta),"\nProbes available: ",nrow(MTAB_organoid_beta),sep=""))
## [1] "Samples available: 134\nProbes available: 415080"

Probe filtering based on detection pvalue and detection over background (NA)

Remove probes with high NA count

na_count_probe <-sapply(1:nrow(MTAB_organoid_beta), function(y) length(which(is.na(MTAB_organoid_beta[y,]))))
na_count_probe_good<-which(na_count_probe<(ncol(MTAB_organoid_beta)*0.05))
MTAB_organoid_beta<-MTAB_organoid_beta[na_count_probe_good,]
filt_bead<-nrow(MTAB_organoid_beta)
print(paste("Samples available: ",ncol(MTAB_organoid_beta),"\nProbes available: ",nrow(MTAB_organoid_beta),sep=""))
## [1] "Samples available: 134\nProbes available: 415080"

Remove probes with high detection p value across samples, and any samples with many high detection p value probes

detP <- detectionP(rgset_organoid)
failed <- detP>0.05
bad_det_p<-names(which(rowMeans(failed)>0.01))
bad_det_psamp<-names(which(colMeans(failed)>0.01))

MTAB_organoid_beta<-MTAB_organoid_beta[which(!(rownames(MTAB_organoid_beta)%in%bad_det_p)),]
MTAB_organoid_beta<-MTAB_organoid_beta[,which(!(colnames(MTAB_organoid_beta)%in%bad_det_psamp))]

filt_detp<-nrow(MTAB_organoid_beta)
print(paste("Samples available: ",ncol(MTAB_organoid_beta),"\nProbes available: ",nrow(MTAB_organoid_beta),sep=""))
## [1] "Samples available: 134\nProbes available: 409528"
save(MTAB_organoid_beta, sampleinfo_organoid, file=paste(here("data"),"/MTAB4957_beta_organoids.RData",sep=""))
#load(here("data", "MTAB4957_beta_organoids.RData"))

Tidy meta data available

sampleinfo_organoid<-sampleinfo_organoid[,c(1:16,24:27)]
identical(colnames(MTAB_organoid_beta),sampleinfo_organoid$Assay.Name)
## [1] TRUE
head(sampleinfo_organoid)
##   Source.Name Material.Type Characteristics.organism.
## 1          P1 organism part              Homo sapiens
## 2          P2 organism part              Homo sapiens
## 3          P3 organism part              Homo sapiens
## 4          P4 organism part              Homo sapiens
## 5          P5 organism part              Homo sapiens
## 6          P6 organism part              Homo sapiens
##   Characteristics.individual. Characteristics.cell.type.
## 1                          P1              organism part
## 2                          P2              organism part
## 3                          P3              organism part
## 4                          P4              organism part
## 5                          P5              organism part
## 6                          P6              organism part
##   Characteristics.biosource.type. Characteristics.developmental.stage.
## 1                   organism part                       juvenile stage
## 2                   organism part                       juvenile stage
## 3                   organism part                       juvenile stage
## 4                   organism part                       juvenile stage
## 5                   organism part                       juvenile stage
## 6                   organism part                       juvenile stage
##   Characteristics.sampling.site. Characteristics.age. Unit.time.unit.
## 1                  sigmoid colon              5 to 15            year
## 2                  sigmoid colon              5 to 15            year
## 3                  sigmoid colon              6 to 15            year
## 4                  sigmoid colon              7 to 15            year
## 5                  sigmoid colon              8 to 15            year
## 6                  sigmoid colon              9 to 15            year
##   Term.Source.REF Term.Accession.Number Characteristics.sex.
## 1             EFO            UO_0000036               female
## 2             EFO            UO_0000036                 male
## 3             EFO            UO_0000036                 male
## 4             EFO            UO_0000036                 male
## 5             EFO            UO_0000036                 male
## 6             EFO            UO_0000036                 male
##   Characteristics.passage. Comment..basename.        Assay.Name
## 1           not applicable  5831583005_R01C01 5831583005_R01C01
## 2           not applicable  5831583005_R02C01 5831583005_R02C01
## 3           not applicable  5831583005_R03C01 5831583005_R03C01
## 4           not applicable  5831583005_R04C01 5831583005_R04C01
## 5           not applicable  5831583005_R05C01 5831583005_R05C01
## 6           not applicable  5831583005_R06C01 5831583005_R06C01
##   Factor.Value..block.    sentrix
## 1                    5 5831583005
## 2                    5 5831583005
## 3                    5 5831583005
## 4                    5 5831583005
## 5                    5 5831583005
## 6                    5 5831583005
##                                                                                                array.id.path
## 1 /nfs/research1/zerbino/redgar/DNAm_organoid_passage/data/published_organoids/E_MTAB_4957/5831583005_R01C01
## 2 /nfs/research1/zerbino/redgar/DNAm_organoid_passage/data/published_organoids/E_MTAB_4957/5831583005_R02C01
## 3 /nfs/research1/zerbino/redgar/DNAm_organoid_passage/data/published_organoids/E_MTAB_4957/5831583005_R03C01
## 4 /nfs/research1/zerbino/redgar/DNAm_organoid_passage/data/published_organoids/E_MTAB_4957/5831583005_R04C01
## 5 /nfs/research1/zerbino/redgar/DNAm_organoid_passage/data/published_organoids/E_MTAB_4957/5831583005_R05C01
## 6 /nfs/research1/zerbino/redgar/DNAm_organoid_passage/data/published_organoids/E_MTAB_4957/5831583005_R06C01
##       det_pval
## 1 0.0009280434
## 2 0.0002483935
## 3 0.0003242456
## 4 0.0002260101
## 5 0.0002923051
## 6 0.0004080649

Seperate out primary pediatric samples

sampleinfo_ped_primary<-sampleinfo_organoid[which(sampleinfo_organoid$Characteristics.developmental.stage.=="juvenile stage" & sampleinfo_organoid$Characteristics.biosource.type.=="purified cell"),]
print(paste("Primary pediatric samples available: ",nrow(sampleinfo_ped_primary), sep=""))
## [1] "Primary pediatric samples available: 35"
# Three samples are the non-epithelial portion
sampleinfo_ped_primary<-sampleinfo_ped_primary[-grep("non-epithelial",sampleinfo_ped_primary$Characteristics.cell.type.),]
organoid_ped_primary<-MTAB_organoid_beta[,which(colnames(MTAB_organoid_beta)%in%sampleinfo_ped_primary$Assay.Name)]
identical(colnames(organoid_ped_primary),sampleinfo_ped_primary$Assay.Name)
## [1] TRUE
print(paste("Primary samples available: ",nrow(sampleinfo_ped_primary), sep=""))
## [1] "Primary samples available: 32"

Seperate out primary fetal samples

sampleinfo_fetal_primary<-sampleinfo_organoid[which(sampleinfo_organoid$Characteristics.developmental.stage.=="fetal stage" & sampleinfo_organoid$Characteristics.biosource.type.=="purified cell"),]
print(paste("Primary fetal samples available: ",nrow(sampleinfo_fetal_primary), sep=""))
## [1] "Primary fetal samples available: 11"
organoid_fetal_primary<-MTAB_organoid_beta[,which(colnames(MTAB_organoid_beta)%in%sampleinfo_fetal_primary$Assay.Name)]
identical(colnames(organoid_fetal_primary),sampleinfo_fetal_primary$Assay.Name)
## [1] TRUE
print(paste("Primary samples available: ",nrow(sampleinfo_fetal_primary), sep=""))
## [1] "Primary samples available: 11"

Only organoids

sampleinfo_organoid<-sampleinfo_organoid[which(sampleinfo_organoid$Characteristics.biosource.type.=="organoid"),]
MTAB_organoid_beta<-MTAB_organoid_beta[,which(colnames(MTAB_organoid_beta)%in%sampleinfo_organoid$Assay.Name)]
identical(colnames(MTAB_organoid_beta),sampleinfo_organoid$Assay.Name)
## [1] TRUE
print(paste("Organoid samples available: ",nrow(sampleinfo_organoid), sep=""))
## [1] "Organoid samples available: 82"

Numeric passage

sampleinfo_organoid$passage.or.rescope.no_numeric<-as.factor(as.character(sampleinfo_organoid$Characteristics.passage.))
levels(sampleinfo_organoid$passage.or.rescope.no_numeric)<-c(1,11,12,14,18,2,21,23,3,4,5,6,7,8,9)
sampleinfo_organoid$passage.or.rescope.no_numeric<-as.numeric(as.character(sampleinfo_organoid$passage.or.rescope.no_numeric))

sample_ID to include patient and tissue

sampleinfo_organoid$sample_ID<-paste(sampleinfo_organoid$Characteristics.individual., sampleinfo_organoid$Characteristics.sampling.site.)

Extracting information from source name and associated paper

remove AP as it seems to indicate a mixture of passages (i.e P1AP6)? These aen’t mentioned in manscript?

sampleinfo_organoid<-sampleinfo_organoid[-grep("AP",sampleinfo_organoid$Source.Name),]

Unclear what GM and IM are but it seems like only 281 was under these conditions, so will exclude to be safe

sampleinfo_organoid<-sampleinfo_organoid[-grep("281",sampleinfo_organoid$Source.Name),]

tidy condition

sampleinfo_organoid$condition<-NA

need to grep for WT and Clone B

sampleinfo_organoid$condition[grep("WT",sampleinfo_organoid$Source.Name)]<-"WT"
sampleinfo_organoid$condition[grep("Clone B|CloneB",sampleinfo_organoid$Source.Name)]<-"KO"

DM seems to be differenitated and SCM is maybe undifferentiated

sampleinfo_organoid$condition[grep("SCM",sampleinfo_organoid$Source.Name)]<-"SCM"
sampleinfo_organoid$condition[grep("DM",sampleinfo_organoid$Source.Name)]<-"DM4d"

print(paste("Organoid samples available: ",nrow(sampleinfo_organoid), sep=""))
## [1] "Organoid samples available: 70"
# match the DNAm data
MTAB_organoid_beta<-MTAB_organoid_beta[,which(colnames(MTAB_organoid_beta)%in%sampleinfo_organoid$Assay.Name)]
identical(colnames(MTAB_organoid_beta),sampleinfo_organoid$Assay.Name)
## [1] TRUE
Filter samples later run in both dataset

Individuals “212” “223” “224” “225” “369” are in both studies. The organoids from these individuals will be removed from the differential DNAm analysis, but visulized later to show the patterns occur across array type Saving them for later integration

sampleinfo_organoid_paired<-sampleinfo_organoid[grep("212|223|224",sampleinfo_organoid$Characteristics.individual.),]
MTAB4957_beta_for_paird<-MTAB_organoid_beta[,which(colnames(MTAB_organoid_beta)%in%sampleinfo_organoid_paired$Assay.Name)]
identical(colnames(MTAB4957_beta_for_paird), sampleinfo_organoid_paired$Assay.Name)
## [1] TRUE
print(paste("Organoid samples available: ",nrow(sampleinfo_organoid_paired), sep=""))
## [1] "Organoid samples available: 16"

load the EPIC organoids

load(here("data","beta_organoids.RData"))

intersect(sampleinfo_organoid$Characteristics.individual., epic.organoid$case.no)
## [1] "212" "223" "224" "225" "369"

369 and 225 are run at identical passages in both cohorts so all samples will be removed.

sampleinfo_organoid[grep("369",sampleinfo_organoid$Characteristics.individual.),c(1,4,8,9,13,21,22)]
##        Source.Name Characteristics.individual.
## 105  369 TI P3 SCM                         369
## 106 369 TI P3 DM4d                         369
## 108  369 SC P3 SCM                         369
## 110 369 SC P3 DM4d                         369
##     Characteristics.sampling.site. Characteristics.age.
## 105                 terminal ileum                    9
## 106                 terminal ileum                    9
## 108                  sigmoid colon                    9
## 110                  sigmoid colon                    9
##     Characteristics.sex. passage.or.rescope.no_numeric          sample_ID
## 105                 male                             3 369 terminal ileum
## 106                 male                             3 369 terminal ileum
## 108                 male                             3  369 sigmoid colon
## 110                 male                             3  369 sigmoid colon
epic.organoid[grep("369",epic.organoid$case.no),c(1,5,17, 9, 10)]
##    case.no sample.site passage.or.rescope.no_numeric sex age
## 22     369          SC                             3   M   9
## 23     369          TI                             3   M   9
sampleinfo_organoid<-sampleinfo_organoid[-grep("369|225",sampleinfo_organoid$Characteristics.individual.),]

212,223 and 224 have organoids at passages only used in MTAB-4957. So organoids that are included at the same passage will be removed.

remove_sampleID<-c("212 SC P6","212 TI P6","223 SC P2","223 TI P2","224 SC P3","224 TI P2")
sampleinfo_organoid<-sampleinfo_organoid[which(!(sampleinfo_organoid$Source.Name%in%remove_sampleID)),]

print(paste("Organoid samples available: ",nrow(sampleinfo_organoid), sep=""))
## [1] "Organoid samples available: 58"
# match the DNAm data
MTAB_organoid_beta<-MTAB_organoid_beta[,which(colnames(MTAB_organoid_beta)%in%sampleinfo_organoid$Assay.Name)]
identical(colnames(MTAB_organoid_beta),sampleinfo_organoid$Assay.Name)
## [1] TRUE

Fetal, pedatric and adult organoids together

pca_res <- prcomp(t(MTAB_organoid_beta))
Loadings<-as.data.frame(pca_res$x)
vars <- pca_res$sdev^2
Importance<-vars/sum(vars)

meta_categorical <- sampleinfo_organoid[, c(4,7,8,13,17,18)]  # input column numbers in meta that contain categorical variables
meta_continuous <- sampleinfo_organoid[, c(9,21)]  # input column numbers in meta that contain continuous variables
colnames(meta_categorical) <- c("Individual", "Developmental Stage","Sample Site","Sex","Block","Sentrix ID")
colnames(meta_continuous) <- c("Age", "Passage")
meta_continuous$Age<-as.numeric(meta_continuous$Age)
meta_categorical$Block<-as.factor(meta_categorical$Block)


ord<-1:length(c(colnames(meta_categorical),colnames(meta_continuous)))
PCs_to_view<-10
suppressWarnings(heat_scree_plot(Loadings, Importance, 2.5, 2.7))

## PC vs PC plot
Loadings$Assay.Name<-rownames(Loadings)
Loadings_meta<-merge(Loadings, sampleinfo_organoid, by="Assay.Name")

ggplot(Loadings_meta, aes(PC1, PC2, fill=Characteristics.developmental.stage.))+geom_point(shape=21,size=3, color="black")+theme_bw()+
  xlab(paste("PC1 (",round(Importance[1]*100,0),"%)", sep=""))+ylab(paste("PC2 (",round(Importance[2]*100,0),"%)", sep=""))+th+theme(axis.text = element_text(size=12),
                                               axis.title = element_text(size=14),
                                               plot.margin = margin(1, 0.1, 1, 1, "cm"))

ggplot(Loadings_meta, aes(PC1, PC2, fill=Characteristics.sampling.site.))+geom_point(shape=21,size=3, color="black")+theme_bw()+
  xlab(paste("PC1 (",round(Importance[1]*100,0),"%)", sep=""))+ylab(paste("PC2 (",round(Importance[2]*100,0),"%)", sep=""))+th+theme(axis.text = element_text(size=12),
                                               axis.title = element_text(size=14),
                                               plot.margin = margin(1, 0.1, 1, 1, "cm"))

ggplot(Loadings_meta, aes(PC2, PC3, fill=Characteristics.sampling.site.))+geom_point(shape=21,size=3, color="black")+theme_bw()+
  xlab(paste("PC1 (",round(Importance[1]*100,0),"%)", sep=""))+ylab(paste("PC2 (",round(Importance[2]*100,0),"%)", sep=""))+th+theme(axis.text = element_text(size=12),
                                                 axis.title = element_text(size=14),
                                                 plot.margin = margin(1, 0.1, 1, 1, "cm"))

pc_plt<-ggplot(Loadings_meta, aes(PC2, PC3, fill=as.factor(passage.or.rescope.no_numeric),color=Characteristics.developmental.stage.))+geom_line(aes(PC2,PC3, group=sample_ID), color="lightgrey")+#, color=sampling.time.point
  geom_point(shape=21,size=3)+#
  theme_bw()+xlab(paste("PC2 (",round(Importance[2]*100,0),"%)", sep=""))+ylab(paste("PC3 (",round(Importance[3]*100,0),"%)", sep=""))+th+theme(axis.text = element_text(size=12),axis.title = element_text(size=14))+
  scale_fill_manual(values=pass_col,name="Passage\nNumber")+scale_color_manual(values=c("black","white","black"))

legend<-ggplot(sampleinfo_organoid, aes(as.factor(-passage.or.rescope.no_numeric), fill=as.factor(passage.or.rescope.no_numeric)))+geom_bar(color="black")+
  theme_bw()+theme(legend.position = "none", axis.text.y = element_blank(),
                   axis.title.y = element_blank(),
                   axis.ticks.y = element_blank(),
                   legend.title=element_text(size=10),
                   legend.text=element_text(size=8))+
  coord_flip()+
  scale_fill_manual(values=pass_col,name="Passage\nNumber")+th

r <- ggplot() + theme_void()

grid.arrange(pc_plt,arrangeGrob(r,legend,r, heights=c(0.6,1.25,0.4)), ncol=2, widths=c(7,1))

High passage fetal toward older organoids?

ggplot(Loadings_meta, aes(PC1, PC2, fill=as.factor(passage.or.rescope.no_numeric), color=Characteristics.developmental.stage.))+geom_line(aes(PC1,PC2, group=sample_ID), color="lightgrey")+#, color=sampling.time.point
  geom_point(shape=21,size=3)+#
  theme_bw()+xlab(paste("PC1 (",round(Importance[1]*100,0),"%)", sep=""))+ylab(paste("PC2 (",round(Importance[2]*100,0),"%)", sep=""))+th+theme(axis.text = element_text(size=12),axis.title = element_text(size=14))+
  scale_fill_manual(values=pass_col,name="Passage\nNumber")+scale_color_manual(values=c("black","white","black"))

Non Fetal samples

sampleinfo_organoid_notfetal<-sampleinfo_organoid[which(sampleinfo_organoid$Characteristics.biosource.type.=="organoid" & sampleinfo_organoid$Characteristics.developmental.stage.!="fetal stage"),]
MTAB_organoid_beta_notfetal<-MTAB_organoid_beta[,which(colnames(MTAB_organoid_beta)%in%sampleinfo_organoid_notfetal$Assay.Name)]
identical(colnames(MTAB_organoid_beta_notfetal),sampleinfo_organoid_notfetal$Assay.Name)
## [1] TRUE

PCA

pca_res <- prcomp(t(MTAB_organoid_beta_notfetal))
Loadings<-as.data.frame(pca_res$x)
vars <- pca_res$sdev^2
Importance<-vars/sum(vars)

meta_categorical <- sampleinfo_organoid_notfetal[, c(4,7,8,13,17,18)]  # input column numbers in meta that contain categorical variables
meta_continuous <- sampleinfo_organoid_notfetal[, c(9,21)]  # input column numbers in meta that contain continuous variables
colnames(meta_categorical) <- c("Individual", "Developmental Stage","Sample Site","Sex","Block","Sentrix ID")
colnames(meta_continuous) <- c("Age", "Passage")
meta_continuous$Age<-as.numeric(meta_continuous$Age)
meta_categorical$Block<-as.factor(meta_categorical$Block)

ord<-1:length(c(colnames(meta_categorical),colnames(meta_continuous)))
PCs_to_view<-10
suppressWarnings(heat_scree_plot(Loadings, Importance, 2.5, 2.7))

## PC vs PC plot
Loadings$Assay.Name<-rownames(Loadings)
Loadings_meta<-merge(Loadings, sampleinfo_organoid_notfetal, by="Assay.Name")

Sample Site

ggplot(Loadings_meta, aes(PC1, PC2, fill=Characteristics.sampling.site.))+geom_point(shape=21,size=3, color="black")+theme_bw()+
  xlab(paste("PC1 (",round(Importance[1]*100,0),"%)", sep=""))+ylab(paste("PC2 (",round(Importance[2]*100,0),"%)", sep=""))+th+theme(axis.text = element_text(size=12),
                                               axis.title = element_text(size=14),
                                               plot.margin = margin(1, 0.1, 1, 1, "cm"))

Condition

ggplot(Loadings_meta, aes(PC1, PC2, fill=condition))+geom_point(shape=21,size=3, color="black")+theme_bw()+
  xlab(paste("PC1 (",round(Importance[1]*100,0),"%)", sep=""))+ylab(paste("PC2 (",round(Importance[2]*100,0),"%)", sep=""))+th+theme(axis.text = element_text(size=12),
                                               axis.title = element_text(size=14),
                                               plot.margin = margin(1, 0.1, 1, 1, "cm"))

Sample Site PC2/3

ggplot(Loadings_meta, aes(PC2, PC3, fill=Characteristics.sampling.site.))+geom_point(shape=21,size=3, color="black")+theme_bw()+
  xlab(paste("PC2 (",round(Importance[2]*100,0),"%)", sep=""))+ylab(paste("PC3 (",round(Importance[3]*100,0),"%)", sep=""))+th+theme(axis.text = element_text(size=12),
                                               axis.title = element_text(size=14),
                                               plot.margin = margin(1, 0.1, 1, 1, "cm"))

Sample Site PC3/4

ggplot(Loadings_meta, aes(PC3, PC4, fill=Characteristics.sampling.site.))+geom_point(shape=21,size=3, color="black")+theme_bw()+
  xlab(paste("PC3 (",round(Importance[3]*100,0),"%)", sep=""))+ylab(paste("PC4 (",round(Importance[4]*100,0),"%)", sep=""))+th+theme(axis.text = element_text(size=12),
                                               axis.title = element_text(size=14),
                                               plot.margin = margin(1, 0.1, 1, 1, "cm"))

pc_plt<-ggplot(Loadings_meta, aes(PC2, PC3, fill=as.factor(passage.or.rescope.no_numeric)))+geom_line(aes(PC2,PC3, group=sample_ID), color="lightgrey")+#, color=sampling.time.point
  geom_point(shape=21,size=3)+#
  theme_bw()+xlab(paste("PC2 (",round(Importance[2]*100,0),"%)", sep=""))+ylab(paste("PC3 (",round(Importance[3]*100,0),"%)", sep=""))+th+theme(axis.text = element_text(size=12),axis.title = element_text(size=14))+
  scale_fill_manual(values=pass_col,name="Passage\nNumber")+scale_color_manual(values=c("black","white","black"))

legend<-ggplot(sampleinfo_organoid_notfetal, aes(as.factor(-passage.or.rescope.no_numeric), fill=as.factor(passage.or.rescope.no_numeric)))+geom_bar(color="black")+
  theme_bw()+theme(legend.position = "none", axis.text.y = element_blank(),
                   axis.title.y = element_blank(),
                   axis.ticks.y = element_blank(),
                   legend.title=element_text(size=10),
                   legend.text=element_text(size=8))+
  coord_flip()+
  scale_fill_manual(values=pass_col,name="Passage\nNumber")+th

r <- ggplot() + theme_void()

grid.arrange(pc_plt,arrangeGrob(r,legend,r, heights=c(0.6,1.25,0.4)), ncol=2, widths=c(7,1))

Variable Beta Distribution (not fetal)

Variation<-function(x) {quantile(x, c(0.9), na.rm=T)[[1]]-quantile(x, c(0.1), na.rm=T)[[1]]}
Mval<-function(beta) log2(beta/(1-beta))

MTAB4957_mval= apply(MTAB_organoid_beta_notfetal, 1, Mval) # need mvalues for combat
MTAB4957_mval = as.data.frame(MTAB4957_mval)
MTAB4957_mval = t(MTAB4957_mval)

ref_range_dnam<-sapply(1:nrow(MTAB4957_mval), function(x) Variation(MTAB4957_mval[x,]))
dim(MTAB4957_beta_VeryVariable<-MTAB_organoid_beta_notfetal[which(ref_range_dnam>=2.75),])#  47924
## [1] 47924    30
## Beta distribution plot
Beta_melted<- melt(MTAB4957_beta_VeryVariable)
Beta_Plot<-Beta_melted[which(!(is.na(Beta_melted$value))),]
colnames(Beta_Plot)<-c("CpG","ID","Beta")
Beta_Plot<-merge(Beta_Plot,sampleinfo_organoid_notfetal, by.x="ID", by.y="Assay.Name")

Beta_Plot$passage.or.rescope.no_numeric.factor <- factor(Beta_Plot$passage.or.rescope.no_numeric, levels = c(11,9,8,6,4,3,2,1))

ggplot(Beta_Plot, aes(Beta,color=passage.or.rescope.no_numeric.factor))+
  geom_density(size=1)+theme_bw()+xlab("DNAm Beta Value")+ylab("Density")+
  scale_color_manual(values=pass_col, name="Passage\nNumber")+th+theme(legend.text = element_text(size=7),
                                                      legend.title = element_text(size=10),
                                                      legend.key.size = unit(0.7,"line"))

To view the beta distributions we will also include a line for the 32 primary samples to compare each passage to primary

MTAB4957_mval= apply(organoid_ped_primary, 1, Mval) # need mvalues for combat
MTAB4957_mval = as.data.frame(MTAB4957_mval)
MTAB4957_mval = t(MTAB4957_mval)

ref_range_dnam_primary<-sapply(1:nrow(MTAB4957_mval), function(x) Variation(MTAB4957_mval[x,]))
dim(organoid_ped_primary_VeryVariable<-organoid_ped_primary[rev(order(ref_range_dnam_primary)),])
## [1] 409528     32

Include the same number of vairable CpGs as organoids varible. So take the 47924 most variable

dim(organoid_ped_primary_VeryVariable<-organoid_ped_primary_VeryVariable[1:47924 ,])
## [1] 47924    32
Beta_melted_MTAB_primary<- melt(organoid_ped_primary_VeryVariable)
Beta_Plot_MTAB_primary<-Beta_melted_MTAB_primary[which(!(is.na(Beta_melted_MTAB_primary$value))),]
colnames(Beta_Plot_MTAB_primary)<-c("CpG","ID","Beta")
Beta_Plot_MTAB_primary<-merge(Beta_Plot_MTAB_primary,sampleinfo_ped_primary, by.x="ID", by.y="Assay.Name")
Beta_plot_primary<-Beta_Plot_MTAB_primary[,c(1:3)]
Beta_plot_primary$passage.or.rescope.no_numeric<-0
Beta_Plot<-Beta_Plot[,c(1:3,23)]

Beta_Plot_combined<-rbind(Beta_plot_primary,Beta_Plot)

Beta_Plot_combined$passage.or.rescope.no_numeric.factor <- factor(Beta_Plot_combined$passage.or.rescope.no_numeric, levels = c(11,9,8,6,4,3,2,1,0))

ggplot(Beta_Plot_combined, aes(Beta,color=as.factor(passage.or.rescope.no_numeric.factor)))+
  geom_density(size=1)+theme_bw()+xlab("DNAm Beta Value")+ylab("Density")+
  scale_color_manual(values=pass_col, name="Passage\nNumber")+th+theme(legend.text = element_text(size=7),
                                                                       legend.title = element_text(size=10),
                                                                       legend.key.size = unit(0.7,"line"))

ggsave(here("figs","MTAB4957_beta_notfetal_with_primary.pdf"),width = 3.75, height = 2.5)
ggsave(here("figs/jpeg","MTAB4957_beta_notfetal_with_primary.jpeg"), width = 3.75, height = 2.5)

Paired Samples in beta plots

These are just the from the individuals not shared across studies

sampleinfo_organoid_notfetal$sample.site<-as.factor(sampleinfo_organoid_notfetal$Characteristics.sampling.site.)
levels(sampleinfo_organoid_notfetal$sample.site)<-c("SC","TI")
sampleinfo_organoid_notfetal$sample_ID<-paste(sampleinfo_organoid_notfetal$Characteristics.individual., sampleinfo_organoid_notfetal$sample.site)
sampleinfo_organoid_paired_unique<-sampleinfo_organoid_notfetal[which(sampleinfo_organoid_notfetal$sample_ID%in%sampleinfo_organoid_notfetal$sample_ID[duplicated(sampleinfo_organoid_notfetal$sample_ID)]),]


MTAB4957.organoid_paired<-do.call(rbind,lapply(1:length(unique(sampleinfo_organoid_paired_unique$sample_ID)), function(x){
  sample<-unique(sampleinfo_organoid_paired_unique$sample_ID)[x]
  samp<-sampleinfo_organoid_paired_unique[sampleinfo_organoid_paired_unique$sample_ID==sample,]
  samp<-samp[order(samp$passage.or.rescope.no_numeric),]
  samp$hilo<-as.factor(samp$passage.or.rescope.no_numeric)

  if(length(levels(samp$hilo))==2){levels(samp$hilo)<-c("lower","higher")}else{
    if(length(levels(samp$hilo))==3){levels(samp$hilo)<-c("lower","higher","highest")}else{
      if(length(levels(samp$hilo))==4){levels(samp$hilo)<-c("lowest","lower","higher","highest")}else{samp$hilo<-NA}
    }
  }
  samp
}))

MTAB4957.organoid_paired<-MTAB4957.organoid_paired[which(!is.na(MTAB4957.organoid_paired$hilo)),]
## will include 224 in the combined plot with its passage 2,3 samples that were on the epic
MTAB4957.organoid_paired<-MTAB4957.organoid_paired[-(grep("224", MTAB4957.organoid_paired$Source.Name)),]

MTAB4957_beta_VeryVariable_paird<-MTAB4957_beta_VeryVariable[,which(sampleinfo_organoid_notfetal$sample_ID%in%MTAB4957.organoid_paired$sample_ID)]

Beta_melted<- melt(MTAB4957_beta_VeryVariable_paird)
Beta_Plot<-Beta_melted[which(!(is.na(Beta_melted$value))),]
colnames(Beta_Plot)<-c("CpG","ID","Beta")
Beta_Plot<-merge(Beta_Plot,MTAB4957.organoid_paired, by.x="ID", by.y="Assay.Name")


labels<-as.data.frame(tapply(MTAB4957.organoid_paired$passage.or.rescope.no_numeric, MTAB4957.organoid_paired$sample_ID, function(x) paste(x, collapse=", ")))
colnames(labels)<-"passge"
labels$sample_ID<-rownames(labels)

ggplot()+
  geom_density(aes(Beta,color=hilo, group=ID),Beta_Plot, size=0.75)+theme_bw()+xlab("DNAm Beta Value")+ylab("Density")+
  scale_color_manual(values = c ("#9ecae1", "#225ea8", "#081d58"), name="Relative\nPassage\nLevel within\nPatient")+facet_wrap(~sample_ID, nrow=1)+
  geom_text(aes(0.75, 2.75, label=passge), data=labels, color="grey20")+th+theme(strip.text = element_text(size = 10),
                                                                                 axis.text=element_text(size=4),
                                                                                 panel.spacing = unit(0.7, "lines"))+th+
  scale_x_continuous(breaks = c(0,0.5,1))

ggsave(here("figs","MTAB4957_beta_paired_notfetal.pdf"),width = 5, height = 2.2)
ggsave(here("figs/jpeg","MTAB4957_beta_paired_notfetal.jpeg"), width = 5, height = 2.2)

Paired not fetal EPIC and 450K

these are individuals present in both studies

intersect(sampleinfo_organoid_paired$Characteristics.individual., epic.organoid$case.no)
## [1] "212" "223" "224"
organoid_Mval = apply(organoid_beta, 1, Mval) # need mvalues for combat
organoid_Mval = as.data.frame(organoid_Mval)
organoid_Mval = t(organoid_Mval)

ref_range_dnam<-sapply(1:nrow(organoid_Mval), function(x) Variation(organoid_Mval[x,]))
organoid_beta_VeryVariable<-organoid_beta[which(ref_range_dnam>=2.75),]#  51545

“212” “223” “224” in both studes

epic.organoid_paired<-epic.organoid[grep("212|223|224",epic.organoid$case.no),]

MTAB4957_beta_VeryVariable_paird<-MTAB4957_beta_for_paird[which(rownames(MTAB4957_beta_for_paird)%in%rownames(MTAB4957_beta_VeryVariable)),]
identical(colnames(MTAB4957_beta_VeryVariable_paird), as.character(sampleinfo_organoid_paired$Assay.Name))
## [1] TRUE
epic.organoid_beta_VeryVariable_paird<-organoid_beta_VeryVariable[,which(colnames(organoid_beta_VeryVariable)%in%epic.organoid_paired$array.id)]
epic.organoid_beta_VeryVariable_paird<-epic.organoid_beta_VeryVariable_paird[,match(epic.organoid_paired$array.id,colnames(epic.organoid_beta_VeryVariable_paird))]
identical(colnames(epic.organoid_beta_VeryVariable_paird), as.character(epic.organoid_paired$array.id))
## [1] TRUE
epic.organoid_paired$Study<-"Cohort 1 Organoids"

sampleinfo_organoid_paired$Study<-"Cohort 2"
sampleinfo_organoid_paired$sample_ID<-gsub(" sigmoid colon", " SC",sampleinfo_organoid_paired$sample_ID)
sampleinfo_organoid_paired$sample_ID<-gsub(" terminal ileum", " TI",sampleinfo_organoid_paired$sample_ID)
colnames(sampleinfo_organoid_paired)[c(4,16)]<-c("case.no","array.id")

samplinfo_paired_combined<-rbind(epic.organoid_paired[,c(1,2,14,17,18)],sampleinfo_organoid_paired[,c(4,16,22,21,24)])

variable_beta_combined<-merge(epic.organoid_beta_VeryVariable_paird,MTAB4957_beta_VeryVariable_paird, by="row.names")
variable_beta_combined$Row.names<-NULL
identical(colnames(variable_beta_combined), as.character(samplinfo_paired_combined$array.id))
## [1] TRUE
samplinfo_paired_combined<-do.call(rbind,lapply(1:length(unique(samplinfo_paired_combined$sample_ID)), function(x){
  sample<-unique(samplinfo_paired_combined$sample_ID)[x]
  samp<-samplinfo_paired_combined[samplinfo_paired_combined$sample_ID==sample,]
  samp<-samp[order(samp$passage.or.rescope.no_numeric),]
  samp$hilo<-as.factor(samp$passage.or.rescope.no_numeric)
  
  if(length(levels(samp$hilo))==2){levels(samp$hilo)<-c("lower","higher")}else{
    if(length(levels(samp$hilo))==3){levels(samp$hilo)<-c("lower","higher","highest")}else{
      if(length(levels(samp$hilo))==4){levels(samp$hilo)<-c("lowest","lower","higher","highest")}else{samp$hilo<-NA}
    }
  }
  samp
}))


Beta_melted<- melt(variable_beta_combined)
## No id variables; using all as measure variables
Beta_Plot<-Beta_melted[which(!(is.na(Beta_melted$value))),]
colnames(Beta_Plot)<-c("ID","Beta")
Beta_Plot<-merge(Beta_Plot,samplinfo_paired_combined, by.x="ID", by.y="array.id")

Beta_Plot$hilo_epic<-paste(Beta_Plot$hilo,"\n", Beta_Plot$Study, sep="")
Beta_Plot$hilo_epic[grep("lower\nCohort 1 Organoids", Beta_Plot$hilo_epic)]<-"lower\nCohort 1"
Beta_Plot$hilo_epic<-factor(Beta_Plot$hilo_epic, levels=c("lower\nCohort 1", "lower\nCohort 2", "higher\nCohort 2", "highest\nCohort 2"))

labels<-as.data.frame(tapply(samplinfo_paired_combined$passage.or.rescope.no_numeric, list(samplinfo_paired_combined$sample_ID,samplinfo_paired_combined$Study), function(x) paste(x, collapse=", ")))
labels$sample_ID<-rownames(labels)

labels$MTAB<-paste("Cohort 2: ", labels$`Cohort 2`, sep="")
labels$OG<-paste("Cohort 1: ", labels$`Cohort 1 Organoids`, sep="")



ggplot()+
  geom_density(aes(Beta,color=hilo_epic, group=ID),Beta_Plot, size=0.75)+theme_bw()+xlab("DNAm Beta Value")+ylab("Density")+
  scale_color_manual(values = c ("#ef3b2c", "#9ecae1","#225ea8","#081d58"), name="Relative\nPassage\nLevel within\nPatient")+facet_wrap(~sample_ID, nrow=3)+
  geom_text(aes(0.5, 2.55, label=MTAB), data=labels, color="grey20", size=2.75)+
  geom_text(aes(0.456, 2.25, label=OG), data=labels, color="grey20", size=2.75)+
  th+theme(strip.text = element_text(size = 12),
           axis.text=element_text(size=10),
           panel.spacing = unit(0.7, "lines"),
        legend.text=element_text(size=9.5),
        legend.title=element_text(size=12))+ scale_x_continuous(breaks = c(0,0.5,1))

ggsave(here("figs","MTAB4957_EPIC_beta_paired.pdf"),width = 6, height = 6)
ggsave(here("figs/jpeg","MTAB4957_EPIC_beta_paired.jpeg"), width = 6, height = 6)

Thresholding trimodal samples

sampleinfo_organoid_notfetal$thresholded_prior_ratio<-sapply(1:nrow(sampleinfo_organoid_notfetal), function(x){
  print(x)
  converted<-as.numeric(round(MTAB4957_beta_VeryVariable[,x]*1000,0))
  counts<-rep(1000, length(converted))
  res = em(converted, counts, .41, .31, .27, 0.01, .1, .1, .90, .03, .5, .05)
  passage_threshold_params(converted, counts, res)
})
## [1] 1
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -270103.38       0.60       0.23       0.15       0.02       0.16
##  [7]       0.09       0.87       0.04       0.51       0.05
##  [1] -265610.50       0.65       0.20       0.12       0.03       0.18
##  [7]       0.10       0.85       0.04       0.51       0.04
##  [1] -264849.45       0.66       0.19       0.11       0.04       0.20
##  [7]       0.11       0.84       0.04       0.52       0.04
##  [1] -264579.20       0.67       0.18       0.10       0.04       0.21
##  [7]       0.11       0.83       0.04       0.52       0.04
##  [1] -264483.85       0.67       0.18       0.10       0.05       0.21
##  [7]       0.12       0.83       0.04       0.52       0.04
##  [1] -264462.54       0.67       0.18       0.10       0.05       0.22
##  [7]       0.12       0.82       0.05       0.53       0.04
##  [1] -264472.22       0.67       0.18       0.10       0.06       0.22
##  [7]       0.12       0.82       0.05       0.53       0.04
## [1] 2
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -267948.50       0.57       0.28       0.12       0.02       0.14
##  [7]       0.09       0.87       0.04       0.50       0.05
##  [1] -265150.42       0.62       0.26       0.09       0.03       0.15
##  [7]       0.10       0.85       0.04       0.51       0.04
##  [1] -264649.49       0.64       0.25       0.08       0.04       0.15
##  [7]       0.11       0.84       0.05       0.51       0.04
##  [1] -264426.43       0.64       0.24       0.07       0.04       0.16
##  [7]       0.11       0.83       0.05       0.51       0.04
##  [1] -264304.19       0.65       0.24       0.07       0.05       0.16
##  [7]       0.11       0.82       0.05       0.51       0.04
##  [1] -264228.23       0.65       0.24       0.06       0.05       0.16
##  [7]       0.11       0.82       0.05       0.51       0.04
##  [1] -264174.45       0.64       0.24       0.06       0.06       0.16
##  [7]       0.11       0.81       0.05       0.51       0.04
##  [1] -264131.03       0.64       0.23       0.06       0.06       0.16
##  [7]       0.11       0.81       0.05       0.51       0.04
##  [1] -264091.61       0.64       0.23       0.06       0.07       0.16
##  [7]       0.11       0.80       0.06       0.51       0.04
##  [1] -264052.64       0.63       0.23       0.06       0.07       0.16
##  [7]       0.11       0.80       0.06       0.51       0.04
##  [1] -264012.18       0.63       0.23       0.06       0.08       0.15
##  [7]       0.11       0.80       0.06       0.51       0.04
##  [1] -263969.23       0.63       0.23       0.06       0.08       0.15
##  [7]       0.10       0.79       0.06       0.51       0.04
##  [1] -263923.51       0.62       0.23       0.06       0.08       0.15
##  [7]       0.10       0.79       0.06       0.51       0.04
##  [1] -263875.00       0.62       0.23       0.06       0.09       0.15
##  [7]       0.10       0.79       0.06       0.51       0.05
##  [1] -263824.06       0.61       0.23       0.06       0.09       0.15
##  [7]       0.10       0.79       0.06       0.51       0.05
##  [1] -263771.15       0.61       0.23       0.06       0.09       0.15
##  [7]       0.10       0.79       0.06       0.51       0.05
##  [1] -263716.82       0.61       0.23       0.06       0.10       0.15
##  [7]       0.10       0.79       0.06       0.51       0.05
##  [1] -263661.61       0.60       0.23       0.07       0.10       0.14
##  [7]       0.10       0.79       0.06       0.50       0.05
##  [1] -263606.08       0.60       0.23       0.07       0.10       0.14
##  [7]       0.09       0.79       0.06       0.50       0.05
##  [1] -263550.73       0.59       0.23       0.07       0.11       0.14
##  [7]       0.09       0.79       0.06       0.50       0.05
##  [1] -263496.13       0.59       0.23       0.07       0.11       0.14
##  [7]       0.09       0.79       0.06       0.50       0.05
##  [1] -263442.33       0.59       0.23       0.07       0.11       0.14
##  [7]       0.09       0.79       0.06       0.50       0.06
##  [1] -263389.84       0.58       0.23       0.07       0.12       0.14
##  [7]       0.09       0.79       0.06       0.50       0.06
##  [1] -263338.89       0.58       0.23       0.07       0.12       0.13
##  [7]       0.09       0.79       0.06       0.49       0.06
##  [1] -263289.68       0.57       0.23       0.07       0.12       0.13
##  [7]       0.09       0.79       0.06       0.49       0.06
##  [1] -263242.36       0.57       0.23       0.07       0.13       0.13
##  [7]       0.08       0.79       0.06       0.49       0.06
##  [1] -263197.03       0.57       0.23       0.08       0.13       0.13
##  [7]       0.08       0.79       0.06       0.49       0.06
##  [1] -263153.75       0.56       0.23       0.08       0.13       0.13
##  [7]       0.08       0.79       0.06       0.49       0.06
##  [1] -263112.73       0.56       0.23       0.08       0.14       0.13
##  [7]       0.08       0.79       0.06       0.48       0.06
##  [1] -263073.78       0.55       0.23       0.08       0.14       0.13
##  [7]       0.08       0.79       0.06       0.48       0.06
##  [1] -263036.82       0.55       0.22       0.08       0.14       0.12
##  [7]       0.08       0.79       0.06       0.48       0.07
##  [1] -263002.04       0.55       0.22       0.08       0.15       0.12
##  [7]       0.08       0.79       0.06       0.48       0.07
##  [1] -262969.40       0.54       0.22       0.08       0.15       0.12
##  [7]       0.07       0.79       0.06       0.47       0.07
##  [1] -262938.87       0.54       0.22       0.08       0.16       0.12
##  [7]       0.07       0.79       0.07       0.47       0.07
##  [1] -262910.43       0.53       0.22       0.09       0.16       0.12
##  [7]       0.07       0.79       0.07       0.47       0.07
##  [1] -262884.05       0.53       0.22       0.09       0.16       0.12
##  [7]       0.07       0.79       0.07       0.47       0.07
##  [1] -262859.71       0.53       0.22       0.09       0.17       0.11
##  [7]       0.07       0.79       0.07       0.47       0.07
##  [1] -262837.35       0.52       0.22       0.09       0.17       0.11
##  [7]       0.07       0.79       0.07       0.46       0.07
##  [1] -262816.93       0.52       0.22       0.09       0.17       0.11
##  [7]       0.06       0.79       0.07       0.46       0.07
##  [1] -262798.47       0.51       0.22       0.09       0.18       0.11
##  [7]       0.06       0.79       0.07       0.46       0.08
##  [1] -262782.05       0.51       0.22       0.09       0.18       0.11
##  [7]       0.06       0.79       0.07       0.46       0.08
##  [1] -262767.53       0.50       0.21       0.10       0.19       0.11
##  [7]       0.06       0.79       0.07       0.46       0.08
##  [1] -262754.77       0.50       0.21       0.10       0.19       0.11
##  [7]       0.06       0.79       0.07       0.45       0.08
##  [1] -262743.78       0.50       0.21       0.10       0.19       0.10
##  [7]       0.06       0.79       0.07       0.45       0.08
##  [1] -262734.60       0.49       0.21       0.10       0.20       0.10
##  [7]       0.06       0.79       0.07       0.45       0.08
## [1] 3
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -265933.53       0.55       0.26       0.16       0.02       0.14
##  [7]       0.08       0.89       0.04       0.51       0.04
##  [1] -263730.92       0.60       0.24       0.13       0.03       0.14
##  [7]       0.08       0.88       0.05       0.51       0.04
##  [1] -263609.69       0.62       0.23       0.12       0.04       0.14
##  [7]       0.07       0.88       0.05       0.51       0.04
##  [1] -263566.97       0.64       0.21       0.11       0.04       0.13
##  [7]       0.07       0.88       0.05       0.51       0.04
##  [1] -263529.40       0.64       0.20       0.10       0.05       0.13
##  [7]       0.06       0.88       0.05       0.51       0.04
##  [1] -263491.42       0.65       0.20       0.10       0.06       0.12
##  [7]       0.06       0.88       0.05       0.51       0.04
##  [1] -263454.75       0.65       0.19       0.09       0.07       0.12
##  [7]       0.05       0.88       0.05       0.51       0.04
##  [1] -263426.41       0.65       0.19       0.09       0.07       0.11
##  [7]       0.04       0.88       0.05       0.51       0.04
##  [1] -263411.13       0.65       0.18       0.09       0.08       0.10
##  [7]       0.04       0.88       0.05       0.51       0.04
##  [1] -263413.40       0.65       0.18       0.09       0.08       0.10
##  [7]       0.03       0.88       0.04       0.51       0.04
## [1] 4
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -268327.69       0.57       0.27       0.13       0.02       0.14
##  [7]       0.08       0.88       0.04       0.50       0.05
##  [1] -265055.63       0.62       0.26       0.10       0.03       0.15
##  [7]       0.09       0.86       0.05       0.51       0.04
##  [1] -264657.68       0.64       0.25       0.08       0.04       0.16
##  [7]       0.09       0.85       0.05       0.51       0.04
##  [1] -264483.42       0.64       0.24       0.07       0.04       0.16
##  [7]       0.09       0.85       0.05       0.51       0.04
##  [1] -264375.78       0.65       0.23       0.07       0.05       0.16
##  [7]       0.09       0.84       0.06       0.51       0.04
##  [1] -264295.85       0.65       0.23       0.06       0.06       0.16
##  [7]       0.09       0.83       0.06       0.51       0.04
##  [1] -264228.76       0.65       0.23       0.06       0.06       0.16
##  [7]       0.09       0.83       0.06       0.51       0.04
##  [1] -264167.37       0.65       0.23       0.06       0.07       0.16
##  [7]       0.09       0.83       0.06       0.51       0.04
##  [1] -264108.90       0.64       0.23       0.06       0.07       0.16
##  [7]       0.09       0.82       0.06       0.51       0.04
##  [1] -264051.78       0.64       0.23       0.06       0.07       0.16
##  [7]       0.09       0.82       0.06       0.51       0.04
##  [1] -263995.16       0.64       0.23       0.06       0.08       0.16
##  [7]       0.09       0.82       0.06       0.51       0.04
##  [1] -263938.68       0.64       0.22       0.06       0.08       0.15
##  [7]       0.08       0.82       0.06       0.51       0.04
##  [1] -263882.45       0.63       0.22       0.06       0.08       0.15
##  [7]       0.08       0.82       0.07       0.51       0.04
##  [1] -263826.28       0.63       0.22       0.06       0.09       0.15
##  [7]       0.08       0.81       0.07       0.51       0.05
##  [1] -263770.51       0.63       0.22       0.06       0.09       0.15
##  [7]       0.08       0.81       0.07       0.51       0.05
##  [1] -263715.49       0.62       0.22       0.06       0.09       0.15
##  [7]       0.08       0.81       0.07       0.51       0.05
##  [1] -263661.54       0.62       0.22       0.06       0.10       0.15
##  [7]       0.08       0.81       0.07       0.51       0.05
##  [1] -263609.02       0.62       0.22       0.06       0.10       0.15
##  [7]       0.08       0.81       0.07       0.51       0.05
##  [1] -263558.22       0.61       0.22       0.06       0.10       0.14
##  [7]       0.07       0.81       0.07       0.50       0.05
##  [1] -263509.50       0.61       0.22       0.06       0.11       0.14
##  [7]       0.07       0.81       0.07       0.50       0.05
##  [1] -263462.88       0.61       0.22       0.06       0.11       0.14
##  [7]       0.07       0.81       0.07       0.50       0.05
##  [1] -263418.64       0.60       0.22       0.07       0.11       0.14
##  [7]       0.07       0.81       0.07       0.50       0.06
##  [1] -263376.90       0.60       0.22       0.07       0.12       0.14
##  [7]       0.07       0.81       0.07       0.50       0.06
##  [1] -263337.76       0.59       0.22       0.07       0.12       0.14
##  [7]       0.07       0.81       0.07       0.49       0.06
##  [1] -263301.26       0.59       0.22       0.07       0.13       0.13
##  [7]       0.07       0.81       0.07       0.49       0.06
##  [1] -263267.41       0.59       0.22       0.07       0.13       0.13
##  [7]       0.06       0.81       0.07       0.49       0.06
##  [1] -263236.20       0.58       0.21       0.07       0.13       0.13
##  [7]       0.06       0.81       0.07       0.49       0.06
##  [1] -263207.60       0.58       0.21       0.07       0.14       0.13
##  [7]       0.06       0.81       0.07       0.49       0.06
##  [1] -263181.58       0.58       0.21       0.07       0.14       0.13
##  [7]       0.06       0.81       0.07       0.48       0.07
##  [1] -263158.07       0.57       0.21       0.07       0.14       0.13
##  [7]       0.06       0.81       0.07       0.48       0.07
##  [1] -263137.02       0.57       0.21       0.07       0.15       0.13
##  [7]       0.06       0.81       0.07       0.48       0.07
##  [1] -263118.37       0.56       0.21       0.08       0.15       0.12
##  [7]       0.06       0.81       0.07       0.48       0.07
##  [1] -263102.03       0.56       0.21       0.08       0.15       0.12
##  [7]       0.06       0.81       0.07       0.48       0.07
##  [1] -263087.93       0.56       0.21       0.08       0.16       0.12
##  [7]       0.05       0.81       0.07       0.47       0.07
##  [1] -263076.02       0.55       0.21       0.08       0.16       0.12
##  [7]       0.05       0.81       0.07       0.47       0.07
##  [1] -263066.20       0.55       0.21       0.08       0.17       0.12
##  [7]       0.05       0.81       0.07       0.47       0.07
## [1] 5
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -263896.17       0.53       0.28       0.17       0.02       0.13
##  [7]       0.08       0.89       0.03       0.51       0.04
##  [1] -262305.00       0.57       0.26       0.15       0.03       0.13
##  [7]       0.08       0.88       0.03       0.51       0.04
##  [1] -262396.01       0.59       0.25       0.13       0.04       0.13
##  [7]       0.08       0.88       0.03       0.52       0.03
##  [1] -262563.43       0.60       0.24       0.12       0.04       0.12
##  [7]       0.07       0.88       0.03       0.52       0.03
##  [1] -262741.61       0.60       0.23       0.12       0.05       0.12
##  [7]       0.07       0.89       0.03       0.52       0.03
##  [1] -262910.45       0.60       0.23       0.11       0.06       0.12
##  [7]       0.06       0.89       0.03       0.52       0.03
##  [1] -263061.11       0.60       0.22       0.11       0.07       0.11
##  [7]       0.06       0.89       0.03       0.52       0.03
##  [1] -263187.95       0.60       0.22       0.11       0.07       0.11
##  [7]       0.05       0.89       0.02       0.52       0.03
##  [1] -263288.70       0.60       0.21       0.11       0.08       0.11
##  [7]       0.05       0.89       0.02       0.52       0.03
##  [1] -263365.51       0.60       0.21       0.11       0.08       0.10
##  [7]       0.05       0.89       0.02       0.52       0.03
##  [1] -263418.72       0.60       0.21       0.11       0.08       0.10
##  [7]       0.05       0.89       0.02       0.52       0.03
##  [1] -263453.60       0.60       0.21       0.11       0.09       0.10
##  [7]       0.04       0.89       0.02       0.52       0.03
##  [1] -263473.93       0.60       0.21       0.11       0.09       0.10
##  [7]       0.04       0.90       0.02       0.52       0.03
##  [1] -263482.87       0.60       0.20       0.10       0.09       0.09
##  [7]       0.04       0.90       0.02       0.52       0.03
## [1] 6
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -262708.15       0.52       0.31       0.15       0.02       0.12
##  [7]       0.08       0.89       0.03       0.51       0.04
##  [1] -261310.86       0.55       0.30       0.12       0.03       0.11
##  [7]       0.07       0.89       0.03       0.51       0.03
##  [1] -261345.87       0.57       0.29       0.10       0.04       0.11
##  [7]       0.06       0.89       0.03       0.51       0.03
##  [1] -261458.68       0.58       0.28       0.09       0.05       0.10
##  [7]       0.05       0.89       0.03       0.51       0.03
##  [1] -261604.18       0.59       0.27       0.09       0.06       0.09
##  [7]       0.04       0.90       0.03       0.51       0.03
##  [1] -261760.99       0.59       0.26       0.08       0.07       0.09
##  [7]       0.04       0.90       0.02       0.51       0.03
##  [1] -261915.76       0.59       0.25       0.08       0.07       0.08
##  [7]       0.03       0.90       0.02       0.51       0.03
##  [1] -262059.79       0.60       0.25       0.08       0.08       0.08
##  [7]       0.03       0.90       0.02       0.51       0.03
##  [1] -262188.71       0.60       0.24       0.08       0.08       0.08
##  [7]       0.02       0.91       0.02       0.51       0.03
##  [1] -262301.69       0.60       0.24       0.07       0.09       0.07
##  [7]       0.02       0.91       0.02       0.51       0.03
##  [1] -262398.35       0.60       0.24       0.07       0.09       0.07
##  [7]       0.02       0.91       0.02       0.51       0.03
##  [1] -262478.14       0.60       0.23       0.07       0.09       0.07
##  [7]       0.02       0.91       0.02       0.51       0.03
##  [1] -262540.98       0.61       0.23       0.07       0.09       0.07
##  [7]       0.02       0.91       0.01       0.51       0.04
##  [1] -262587.79       0.61       0.23       0.07       0.10       0.07
##  [7]       0.02       0.91       0.01       0.51       0.04
##  [1] -262620.34       0.61       0.23       0.07       0.10       0.07
##  [7]       0.02       0.91       0.01       0.50       0.04
##  [1] -262640.65       0.61       0.22       0.07       0.10       0.07
##  [7]       0.02       0.91       0.01       0.50       0.04
##  [1] -262650.63       0.61       0.22       0.07       0.10       0.07
##  [7]       0.02       0.91       0.01       0.50       0.04
## [1] 7
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -266156.99       0.55       0.23       0.20       0.02       0.14
##  [7]       0.09       0.89       0.04       0.51       0.05
##  [1] -263918.14       0.60       0.20       0.17       0.03       0.15
##  [7]       0.09       0.88       0.04       0.52       0.04
##  [1] -263719.46       0.62       0.19       0.16       0.03       0.16
##  [7]       0.09       0.88       0.04       0.52       0.04
##  [1] -263668.00       0.63       0.18       0.15       0.04       0.16
##  [7]       0.09       0.87       0.04       0.53       0.04
##  [1] -263651.32       0.64       0.17       0.15       0.04       0.16
##  [7]       0.09       0.87       0.04       0.53       0.04
##  [1] -263643.44       0.64       0.16       0.15       0.05       0.15
##  [7]       0.09       0.87       0.04       0.54       0.04
## [1] 8
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269727.89       0.59       0.24       0.15       0.02       0.16
##  [7]       0.09       0.87       0.04       0.50       0.05
##  [1] -265787.44       0.64       0.22       0.11       0.03       0.17
##  [7]       0.10       0.86       0.05       0.51       0.04
##  [1] -265125.41       0.66       0.21       0.10       0.04       0.19
##  [7]       0.10       0.85       0.05       0.51       0.04
##  [1] -264875.78       0.67       0.20       0.09       0.04       0.19
##  [7]       0.11       0.84       0.05       0.52       0.04
##  [1] -264777.19       0.67       0.20       0.09       0.05       0.20
##  [7]       0.11       0.83       0.06       0.52       0.04
##  [1] -264745.47       0.67       0.20       0.09       0.05       0.20
##  [7]       0.11       0.82       0.06       0.52       0.04
##  [1] -264743.71       0.67       0.19       0.08       0.05       0.21
##  [7]       0.12       0.82       0.06       0.52       0.04
## [1] 9
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269947.47       0.59       0.23       0.16       0.02       0.16
##  [7]       0.09       0.87       0.03       0.51       0.05
##  [1] -264782.87       0.63       0.20       0.14       0.03       0.17
##  [7]       0.09       0.85       0.03       0.52       0.04
##  [1] -264002.79       0.65       0.18       0.13       0.03       0.18
##  [7]       0.09       0.84       0.04       0.53       0.04
##  [1] -263744.75       0.66       0.17       0.13       0.04       0.19
##  [7]       0.10       0.83       0.04       0.53       0.04
##  [1] -263658.77       0.66       0.17       0.13       0.05       0.19
##  [7]       0.10       0.83       0.04       0.54       0.04
##  [1] -263640.91       0.66       0.17       0.13       0.05       0.19
##  [7]       0.10       0.82       0.04       0.54       0.04
##  [1] -263649.12       0.65       0.16       0.13       0.06       0.19
##  [7]       0.10       0.82       0.04       0.54       0.04
## [1] 10
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269866.23       0.59       0.25       0.14       0.02       0.15
##  [7]       0.09       0.86       0.03       0.51       0.05
##  [1] -265019.48       0.63       0.22       0.11       0.03       0.17
##  [7]       0.09       0.85       0.04       0.51       0.04
##  [1] -264281.88       0.65       0.21       0.10       0.04       0.17
##  [7]       0.09       0.83       0.04       0.52       0.04
##  [1] -264016.70       0.66       0.20       0.10       0.04       0.18
##  [7]       0.10       0.83       0.04       0.52       0.04
##  [1] -263913.05       0.66       0.20       0.10       0.05       0.18
##  [7]       0.10       0.82       0.04       0.53       0.04
##  [1] -263876.53       0.66       0.19       0.10       0.06       0.18
##  [7]       0.10       0.81       0.04       0.53       0.04
##  [1] -263867.28       0.65       0.19       0.10       0.06       0.18
##  [7]       0.10       0.81       0.04       0.53       0.04
## [1] 11
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269220.74       0.58       0.24       0.16       0.02       0.15
##  [7]       0.09       0.86       0.03       0.51       0.05
##  [1] -264457.82       0.62       0.22       0.13       0.03       0.16
##  [7]       0.09       0.85       0.03       0.52       0.04
##  [1] -263816.32       0.64       0.20       0.12       0.03       0.17
##  [7]       0.09       0.84       0.03       0.52       0.04
##  [1] -263619.25       0.64       0.20       0.12       0.04       0.17
##  [7]       0.09       0.83       0.03       0.53       0.04
##  [1] -263555.15       0.64       0.19       0.12       0.05       0.17
##  [7]       0.09       0.83       0.04       0.53       0.04
##  [1] -263537.61       0.64       0.19       0.12       0.05       0.17
##  [7]       0.09       0.82       0.04       0.53       0.04
##  [1] -263535.21       0.64       0.19       0.12       0.06       0.17
##  [7]       0.09       0.82       0.04       0.53       0.04
## [1] 12
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269547.80       0.58       0.26       0.14       0.02       0.14
##  [7]       0.09       0.86       0.03       0.51       0.05
##  [1] -264712.75       0.62       0.24       0.11       0.03       0.16
##  [7]       0.09       0.84       0.03       0.52       0.04
##  [1] -263961.59       0.64       0.22       0.10       0.04       0.16
##  [7]       0.09       0.83       0.03       0.52       0.04
##  [1] -263706.98       0.65       0.22       0.10       0.04       0.16
##  [7]       0.09       0.82       0.04       0.53       0.04
##  [1] -263619.22       0.65       0.21       0.09       0.05       0.16
##  [7]       0.09       0.81       0.04       0.53       0.04
##  [1] -263597.40       0.64       0.21       0.09       0.05       0.16
##  [7]       0.09       0.81       0.04       0.53       0.04
##  [1] -263600.38       0.64       0.21       0.09       0.06       0.16
##  [7]       0.09       0.80       0.04       0.53       0.04
## [1] 13
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -259769.23       0.48       0.32       0.18       0.02       0.11
##  [7]       0.07       0.90       0.03       0.51       0.03
##  [1] -258078.74       0.50       0.31       0.16       0.03       0.10
##  [7]       0.05       0.90       0.03       0.52       0.03
##  [1] -257929.05       0.51       0.30       0.14       0.04       0.10
##  [7]       0.05       0.90       0.03       0.53       0.02
##  [1] -258104.90       0.52       0.30       0.14       0.05       0.09
##  [7]       0.04       0.91       0.03       0.53       0.02
##  [1] -258378.48       0.51       0.29       0.13       0.06       0.09
##  [7]       0.04       0.91       0.02       0.53       0.02
##  [1] -258619.09       0.51       0.29       0.13       0.07       0.08
##  [7]       0.03       0.91       0.02       0.53       0.01
##  [1] -258783.69       0.50       0.28       0.13       0.08       0.08
##  [7]       0.03       0.91       0.02       0.53       0.01
##  [1] -258876.56       0.50       0.28       0.13       0.09       0.08
##  [7]       0.03       0.91       0.02       0.53       0.02
##  [1] -258911.89       0.49       0.28       0.13       0.09       0.08
##  [7]       0.03       0.91       0.02       0.53       0.02
##  [1] -258909.71       0.49       0.28       0.13       0.10       0.08
##  [7]       0.03       0.91       0.02       0.53       0.02
## [1] 14
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -259752.33       0.48       0.30       0.21       0.02       0.11
##  [7]       0.07       0.90       0.03       0.52       0.04
##  [1] -257997.02       0.50       0.29       0.19       0.02       0.11
##  [7]       0.05       0.90       0.03       0.53       0.03
##  [1] -257877.11       0.51       0.28       0.18       0.03       0.10
##  [7]       0.05       0.91       0.03       0.53       0.02
##  [1] -258059.72       0.52       0.27       0.17       0.05       0.10
##  [7]       0.04       0.91       0.02       0.54       0.02
##  [1] -258347.34       0.52       0.26       0.17       0.06       0.09
##  [7]       0.03       0.91       0.02       0.54       0.02
##  [1] -258622.45       0.51       0.26       0.16       0.07       0.09
##  [7]       0.03       0.91       0.02       0.54       0.02
##  [1] -258836.89       0.51       0.25       0.16       0.07       0.09
##  [7]       0.03       0.91       0.02       0.54       0.01
##  [1] -258972.88       0.51       0.25       0.16       0.08       0.09
##  [7]       0.03       0.91       0.02       0.54       0.01
##  [1] -259051.97       0.50       0.25       0.16       0.08       0.08
##  [7]       0.03       0.91       0.02       0.54       0.01
##  [1] -259083.13       0.50       0.25       0.16       0.09       0.08
##  [7]       0.03       0.91       0.02       0.54       0.02
##  [1] -259088.87       0.50       0.25       0.16       0.09       0.08
##  [7]       0.03       0.91       0.02       0.55       0.02
## [1] 15
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -259682.08       0.48       0.32       0.19       0.02       0.11
##  [7]       0.06       0.90       0.03       0.52       0.03
##  [1] -257554.74       0.50       0.31       0.16       0.03       0.10
##  [7]       0.05       0.90       0.03       0.53       0.03
##  [1] -257281.93       0.51       0.31       0.15       0.04       0.09
##  [7]       0.04       0.91       0.03       0.53       0.02
##  [1] -257424.24       0.51       0.30       0.14       0.05       0.09
##  [7]       0.03       0.91       0.03       0.54       0.02
##  [1] -257696.08       0.51       0.29       0.14       0.06       0.09
##  [7]       0.03       0.91       0.02       0.54       0.02
##  [1] -257947.97       0.50       0.29       0.14       0.07       0.08
##  [7]       0.03       0.91       0.02       0.54       0.01
##  [1] -258121.06       0.49       0.29       0.14       0.08       0.08
##  [7]       0.03       0.91       0.02       0.54       0.01
##  [1] -258214.98       0.49       0.28       0.14       0.09       0.08
##  [7]       0.03       0.91       0.02       0.54       0.01
##  [1] -258247.70       0.49       0.28       0.14       0.09       0.08
##  [7]       0.03       0.91       0.02       0.54       0.01
##  [1] -258245.26       0.48       0.28       0.14       0.10       0.08
##  [7]       0.03       0.91       0.02       0.55       0.01
## [1] 16
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -267714.39       0.56       0.23       0.20       0.02       0.16
##  [7]       0.08       0.89       0.04       0.51       0.05
##  [1] -263840.55       0.59       0.21       0.17       0.02       0.17
##  [7]       0.07       0.88       0.04       0.52       0.04
##  [1] -263510.94       0.61       0.20       0.16       0.03       0.17
##  [7]       0.07       0.88       0.04       0.53       0.04
##  [1] -263426.83       0.62       0.19       0.15       0.04       0.17
##  [7]       0.07       0.87       0.05       0.53       0.04
##  [1] -263404.13       0.63       0.18       0.15       0.04       0.17
##  [7]       0.07       0.87       0.05       0.54       0.04
##  [1] -263402.99       0.63       0.18       0.15       0.04       0.17
##  [7]       0.07       0.87       0.05       0.54       0.04
## [1] 17
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -253828.02       0.42       0.34       0.22       0.01       0.09
##  [7]       0.05       0.92       0.03       0.53       0.03
##  [1] -249506.73       0.43       0.35       0.21       0.02       0.07
##  [7]       0.03       0.93       0.02       0.54       0.02
##  [1] -247643.30       0.42       0.34       0.20       0.04       0.06
##  [7]       0.02       0.93       0.02       0.54       0.02
##  [1] -247096.75       0.42       0.33       0.20       0.05       0.06
##  [7]       0.02       0.93       0.01       0.55       0.01
##  [1] -247104.69       0.41       0.33       0.19       0.07       0.06
##  [7]       0.02       0.93       0.01       0.55       0.01
## [1] 18
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -268311.76       0.56       0.26       0.16       0.02       0.14
##  [7]       0.08       0.87       0.04       0.51       0.05
##  [1] -264655.97       0.60       0.24       0.13       0.03       0.15
##  [7]       0.08       0.86       0.05       0.52       0.05
##  [1] -264080.51       0.62       0.23       0.12       0.03       0.15
##  [7]       0.08       0.85       0.05       0.52       0.04
##  [1] -263871.65       0.63       0.22       0.11       0.04       0.15
##  [7]       0.08       0.84       0.05       0.53       0.04
##  [1] -263795.56       0.64       0.21       0.11       0.04       0.15
##  [7]       0.08       0.83       0.05       0.53       0.04
##  [1] -263775.52       0.64       0.21       0.11       0.04       0.15
##  [7]       0.08       0.83       0.05       0.53       0.04
##  [1] -263777.36       0.64       0.20       0.11       0.05       0.15
##  [7]       0.08       0.82       0.06       0.53       0.04
## [1] 19
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -254974.48       0.43       0.34       0.22       0.01       0.09
##  [7]       0.05       0.92       0.03       0.53       0.03
##  [1] -250206.20       0.43       0.34       0.21       0.02       0.08
##  [7]       0.03       0.93       0.02       0.54       0.02
##  [1] -248591.60       0.43       0.34       0.20       0.03       0.07
##  [7]       0.02       0.93       0.02       0.55       0.01
##  [1] -248222.35       0.42       0.33       0.20       0.05       0.07
##  [7]       0.02       0.93       0.02       0.55       0.01
##  [1] -248282.61       0.41       0.33       0.19       0.07       0.07
##  [7]       0.02       0.94       0.01       0.56       0.01
##  [1] -248417.01       0.40       0.32       0.19       0.08       0.06
##  [7]       0.02       0.94       0.01       0.56       0.01
##  [1] -248490.51       0.40       0.32       0.19       0.09       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248504.56       0.39       0.32       0.19       0.09       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248483.83       0.39       0.32       0.19       0.09       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248447.40       0.39       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248407.71       0.39       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248374.19       0.38       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248340.00       0.38       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248309.41       0.38       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248282.71       0.38       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248259.42       0.38       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248239.13       0.38       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248221.50       0.38       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248206.19       0.38       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248192.91       0.37       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248181.34       0.37       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248171.27       0.37       0.32       0.20       0.11       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248166.53       0.37       0.32       0.20       0.11       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
## [1] 20
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -268423.74       0.56       0.26       0.16       0.02       0.15
##  [7]       0.08       0.88       0.04       0.51       0.05
##  [1] -264539.44       0.60       0.24       0.14       0.02       0.15
##  [7]       0.08       0.86       0.05       0.51       0.05
##  [1] -264042.09       0.62       0.23       0.13       0.03       0.16
##  [7]       0.08       0.85       0.05       0.52       0.04
##  [1] -263869.42       0.63       0.22       0.12       0.03       0.16
##  [7]       0.08       0.85       0.05       0.52       0.04
##  [1] -263802.11       0.63       0.22       0.12       0.04       0.16
##  [7]       0.08       0.84       0.05       0.53       0.04
##  [1] -263777.83       0.63       0.21       0.12       0.04       0.16
##  [7]       0.07       0.84       0.06       0.53       0.04
##  [1] -263770.78       0.63       0.21       0.11       0.04       0.15
##  [7]       0.07       0.83       0.06       0.53       0.04
## [1] 21
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269112.94       0.57       0.19       0.22       0.02       0.19
##  [7]       0.06       0.90       0.04       0.50       0.05
##  [1] -262778.77       0.60       0.18       0.19       0.02       0.21
##  [7]       0.06       0.90       0.05       0.51       0.04
##  [1] -262363.69       0.61       0.18       0.18       0.03       0.21
##  [7]       0.05       0.90       0.05       0.52       0.04
##  [1] -262336.88       0.62       0.17       0.17       0.04       0.22
##  [7]       0.05       0.90       0.05       0.52       0.04
##  [1] -262368.78       0.62       0.17       0.17       0.04       0.22
##  [7]       0.05       0.90       0.05       0.53       0.04
##  [1] -262403.04       0.62       0.17       0.17       0.05       0.22
##  [7]       0.05       0.90       0.05       0.53       0.04
##  [1] -262427.84       0.61       0.17       0.17       0.05       0.22
##  [7]       0.05       0.90       0.04       0.53       0.04
##  [1] -262440.14       0.61       0.17       0.16       0.06       0.22
##  [7]       0.04       0.90       0.04       0.54       0.04
##  [1] -262439.94       0.61       0.17       0.16       0.06       0.22
##  [7]       0.04       0.90       0.04       0.54       0.04
## [1] 22
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -268870.79       0.57       0.22       0.20       0.02       0.15
##  [7]       0.08       0.88       0.04       0.51       0.05
##  [1] -264530.76       0.61       0.19       0.17       0.02       0.17
##  [7]       0.08       0.86       0.04       0.52       0.05
##  [1] -263860.41       0.63       0.18       0.17       0.03       0.17
##  [7]       0.08       0.85       0.04       0.53       0.05
##  [1] -263641.49       0.63       0.17       0.16       0.03       0.18
##  [7]       0.08       0.85       0.05       0.54       0.04
##  [1] -263574.84       0.64       0.16       0.16       0.04       0.18
##  [7]       0.08       0.84       0.05       0.54       0.04
##  [1] -263567.63       0.64       0.16       0.16       0.04       0.18
##  [7]       0.08       0.84       0.05       0.55       0.04
## [1] 23
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -266085.21       0.54       0.26       0.18       0.02       0.14
##  [7]       0.08       0.89       0.04       0.51       0.05
##  [1] -263573.37       0.58       0.24       0.16       0.02       0.14
##  [7]       0.08       0.89       0.05       0.51       0.04
##  [1] -263440.72       0.60       0.23       0.14       0.03       0.14
##  [7]       0.07       0.88       0.05       0.51       0.04
##  [1] -263412.54       0.61       0.22       0.14       0.03       0.14
##  [7]       0.07       0.88       0.05       0.52       0.04
##  [1] -263398.10       0.62       0.21       0.13       0.04       0.14
##  [7]       0.07       0.88       0.05       0.52       0.04
##  [1] -263384.48       0.62       0.21       0.13       0.04       0.14
##  [7]       0.07       0.88       0.05       0.52       0.04
##  [1] -263368.42       0.63       0.20       0.12       0.04       0.13
##  [7]       0.06       0.88       0.05       0.52       0.04
##  [1] -263350.22       0.63       0.20       0.12       0.05       0.13
##  [7]       0.06       0.88       0.05       0.52       0.04
##  [1] -263330.28       0.63       0.20       0.12       0.05       0.12
##  [7]       0.06       0.88       0.05       0.52       0.04
##  [1] -263309.02       0.63       0.19       0.12       0.05       0.12
##  [7]       0.05       0.89       0.05       0.52       0.05
##  [1] -263286.73       0.63       0.19       0.12       0.06       0.12
##  [7]       0.05       0.89       0.05       0.51       0.05
##  [1] -263264.21       0.64       0.19       0.12       0.06       0.12
##  [7]       0.05       0.89       0.05       0.51       0.05
##  [1] -263242.66       0.64       0.18       0.12       0.06       0.11
##  [7]       0.05       0.89       0.05       0.51       0.05
##  [1] -263222.78       0.64       0.18       0.12       0.06       0.11
##  [7]       0.04       0.89       0.05       0.51       0.05
##  [1] -263205.56       0.64       0.18       0.11       0.07       0.11
##  [7]       0.04       0.89       0.05       0.51       0.06
##  [1] -263191.81       0.64       0.18       0.11       0.07       0.11
##  [7]       0.04       0.89       0.04       0.51       0.06
##  [1] -263182.23       0.64       0.17       0.11       0.07       0.10
##  [7]       0.04       0.89       0.04       0.50       0.06
## [1] 24
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -267783.99       0.55       0.24       0.19       0.02       0.14
##  [7]       0.08       0.88       0.04       0.51       0.05
##  [1] -264335.74       0.59       0.22       0.17       0.02       0.15
##  [7]       0.08       0.86       0.04       0.52       0.05
##  [1] -263835.02       0.61       0.20       0.16       0.03       0.16
##  [7]       0.09       0.86       0.05       0.53       0.05
##  [1] -263676.17       0.62       0.19       0.16       0.03       0.16
##  [7]       0.09       0.85       0.05       0.53       0.04
##  [1] -263627.80       0.62       0.19       0.15       0.03       0.16
##  [7]       0.08       0.85       0.05       0.53       0.04
##  [1] -263621.63       0.63       0.18       0.15       0.04       0.16
##  [7]       0.08       0.84       0.05       0.54       0.04
## [1] 25
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -267731.20       0.56       0.23       0.19       0.02       0.15
##  [7]       0.09       0.88       0.04       0.51       0.05
##  [1] -264708.30       0.61       0.20       0.16       0.03       0.17
##  [7]       0.10       0.87       0.04       0.51       0.04
##  [1] -264313.02       0.63       0.19       0.15       0.03       0.17
##  [7]       0.10       0.86       0.04       0.51       0.04
##  [1] -264195.99       0.64       0.18       0.14       0.04       0.18
##  [7]       0.11       0.86       0.04       0.52       0.04
##  [1] -264157.86       0.64       0.18       0.14       0.04       0.18
##  [7]       0.11       0.85       0.05       0.52       0.04
##  [1] -264144.75       0.64       0.17       0.14       0.04       0.19
##  [7]       0.11       0.85       0.05       0.52       0.04
##  [1] -264137.49       0.65       0.17       0.14       0.05       0.19
##  [7]       0.11       0.85       0.05       0.52       0.04
## [1] 26
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269373.79       0.57       0.23       0.18       0.02       0.16
##  [7]       0.09       0.87       0.03       0.51       0.05
##  [1] -264818.67       0.61       0.21       0.15       0.02       0.18
##  [7]       0.09       0.86       0.04       0.51       0.05
##  [1] -264208.75       0.63       0.20       0.14       0.03       0.19
##  [7]       0.09       0.85       0.04       0.52       0.05
##  [1] -264018.42       0.64       0.19       0.14       0.03       0.19
##  [7]       0.09       0.85       0.04       0.52       0.05
##  [1] -263950.31       0.64       0.19       0.13       0.04       0.20
##  [7]       0.10       0.84       0.04       0.52       0.05
##  [1] -263926.62       0.64       0.19       0.13       0.04       0.20
##  [7]       0.10       0.84       0.04       0.53       0.05
##  [1] -263920.06       0.64       0.19       0.13       0.04       0.20
##  [7]       0.10       0.84       0.04       0.53       0.05
## [1] 27
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269824.44       0.58       0.22       0.18       0.02       0.16
##  [7]       0.08       0.87       0.03       0.51       0.05
##  [1] -264468.03       0.61       0.20       0.16       0.02       0.18
##  [7]       0.08       0.86       0.03       0.51       0.05
##  [1] -263797.43       0.63       0.19       0.15       0.03       0.19
##  [7]       0.08       0.85       0.04       0.52       0.05
##  [1] -263601.03       0.64       0.19       0.15       0.03       0.20
##  [7]       0.08       0.85       0.04       0.53       0.05
##  [1] -263538.19       0.64       0.18       0.14       0.04       0.20
##  [7]       0.09       0.84       0.04       0.53       0.05
##  [1] -263523.40       0.64       0.18       0.14       0.04       0.21
##  [7]       0.09       0.84       0.04       0.54       0.05
##  [1] -263527.43       0.63       0.18       0.14       0.04       0.21
##  [7]       0.09       0.84       0.04       0.54       0.05
## [1] 28
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -266204.55       0.54       0.29       0.15       0.02       0.13
##  [7]       0.08       0.88       0.03       0.51       0.05
##  [1] -263710.54       0.58       0.27       0.12       0.03       0.14
##  [7]       0.08       0.87       0.04       0.51       0.04
##  [1] -263504.80       0.60       0.26       0.10       0.03       0.14
##  [7]       0.08       0.86       0.04       0.52       0.04
##  [1] -263452.41       0.61       0.25       0.09       0.04       0.13
##  [7]       0.08       0.86       0.04       0.52       0.04
##  [1] -263434.00       0.62       0.25       0.09       0.05       0.13
##  [7]       0.08       0.86       0.04       0.52       0.04
##  [1] -263424.67       0.62       0.24       0.09       0.05       0.13
##  [7]       0.07       0.86       0.04       0.53       0.04
## [1] 29
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -267788.65       0.56       0.25       0.17       0.02       0.14
##  [7]       0.09       0.88       0.04       0.51       0.05
##  [1] -264511.04       0.60       0.23       0.14       0.02       0.15
##  [7]       0.09       0.87       0.04       0.51       0.05
##  [1] -264073.57       0.62       0.22       0.13       0.03       0.16
##  [7]       0.09       0.86       0.04       0.52       0.05
##  [1] -263913.12       0.63       0.21       0.13       0.03       0.16
##  [7]       0.09       0.85       0.05       0.52       0.04
##  [1] -263840.55       0.63       0.21       0.12       0.04       0.16
##  [7]       0.09       0.85       0.05       0.53       0.04
##  [1] -263804.20       0.63       0.20       0.12       0.04       0.16
##  [7]       0.09       0.84       0.05       0.53       0.04
##  [1] -263783.55       0.63       0.20       0.12       0.04       0.16
##  [7]       0.09       0.84       0.05       0.53       0.04
##  [1] -263769.56       0.63       0.20       0.12       0.05       0.16
##  [7]       0.09       0.84       0.05       0.53       0.04
##  [1] -263757.04       0.63       0.20       0.12       0.05       0.16
##  [7]       0.09       0.84       0.05       0.54       0.05
##  [1] -263743.71       0.63       0.20       0.12       0.05       0.15
##  [7]       0.09       0.84       0.05       0.54       0.05
##  [1] -263728.47       0.63       0.20       0.12       0.05       0.15
##  [7]       0.08       0.84       0.05       0.54       0.05
##  [1] -263710.86       0.62       0.20       0.12       0.06       0.15
##  [7]       0.08       0.84       0.05       0.54       0.05
##  [1] -263690.79       0.62       0.20       0.12       0.06       0.15
##  [7]       0.08       0.84       0.05       0.54       0.05
##  [1] -263668.41       0.62       0.20       0.13       0.06       0.15
##  [7]       0.08       0.84       0.05       0.54       0.05
##  [1] -263643.98       0.61       0.20       0.13       0.06       0.15
##  [7]       0.08       0.84       0.05       0.54       0.05
##  [1] -263617.89       0.61       0.20       0.13       0.06       0.15
##  [7]       0.08       0.84       0.05       0.54       0.05
##  [1] -263590.56       0.61       0.20       0.13       0.07       0.15
##  [7]       0.08       0.84       0.05       0.53       0.05
##  [1] -263562.23       0.61       0.20       0.13       0.07       0.15
##  [7]       0.08       0.84       0.05       0.53       0.05
##  [1] -263533.44       0.60       0.20       0.13       0.07       0.15
##  [7]       0.08       0.84       0.05       0.53       0.05
##  [1] -263504.42       0.60       0.20       0.13       0.07       0.15
##  [7]       0.08       0.84       0.05       0.53       0.06
##  [1] -263475.53       0.60       0.20       0.13       0.08       0.15
##  [7]       0.08       0.84       0.05       0.53       0.06
##  [1] -263447.02       0.59       0.20       0.13       0.08       0.14
##  [7]       0.08       0.84       0.05       0.53       0.06
##  [1] -263419.08       0.59       0.20       0.13       0.08       0.14
##  [7]       0.08       0.84       0.05       0.53       0.06
##  [1] -263391.89       0.59       0.20       0.13       0.08       0.14
##  [7]       0.08       0.84       0.05       0.53       0.06
##  [1] -263365.59       0.58       0.20       0.13       0.08       0.14
##  [7]       0.07       0.84       0.05       0.53       0.06
##  [1] -263340.26       0.58       0.20       0.13       0.09       0.14
##  [7]       0.07       0.84       0.05       0.52       0.06
##  [1] -263315.98       0.58       0.20       0.13       0.09       0.14
##  [7]       0.07       0.84       0.05       0.52       0.06
##  [1] -263292.80       0.57       0.20       0.13       0.09       0.14
##  [7]       0.07       0.84       0.05       0.52       0.06
##  [1] -263270.74       0.57       0.20       0.14       0.09       0.14
##  [7]       0.07       0.84       0.05       0.52       0.07
##  [1] -263249.81       0.57       0.20       0.14       0.10       0.14
##  [7]       0.07       0.84       0.05       0.52       0.07
##  [1] -263230.01       0.56       0.20       0.14       0.10       0.14
##  [7]       0.07       0.84       0.05       0.52       0.07
##  [1] -263211.31       0.56       0.20       0.14       0.10       0.14
##  [7]       0.07       0.84       0.05       0.52       0.07
##  [1] -263193.70       0.55       0.20       0.14       0.10       0.14
##  [7]       0.07       0.84       0.05       0.52       0.07
##  [1] -263177.14       0.55       0.20       0.14       0.11       0.14
##  [7]       0.07       0.84       0.05       0.51       0.07
##  [1] -263161.61       0.55       0.20       0.14       0.11       0.14
##  [7]       0.07       0.84       0.05       0.51       0.07
##  [1] -263147.06       0.54       0.20       0.14       0.11       0.14
##  [7]       0.07       0.84       0.05       0.51       0.07
##  [1] -263133.46       0.54       0.20       0.14       0.12       0.14
##  [7]       0.07       0.84       0.05       0.51       0.07
##  [1] -263120.76       0.54       0.20       0.14       0.12       0.14
##  [7]       0.07       0.84       0.05       0.51       0.08
##  [1] -263108.94       0.53       0.20       0.14       0.12       0.14
##  [7]       0.07       0.84       0.05       0.51       0.08
##  [1] -263097.94       0.53       0.20       0.14       0.12       0.14
##  [7]       0.07       0.84       0.05       0.51       0.08
##  [1] -263087.74       0.52       0.21       0.15       0.13       0.13
##  [7]       0.07       0.84       0.05       0.51       0.08
##  [1] -263078.30       0.52       0.21       0.15       0.13       0.13
##  [7]       0.07       0.84       0.05       0.51       0.08
## [1] 30
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -265331.09       0.54       0.19       0.25       0.02       0.15
##  [7]       0.09       0.89       0.04       0.51       0.05
##  [1] -263250.28       0.59       0.16       0.23       0.02       0.16
##  [7]       0.10       0.88       0.04       0.52       0.04
##  [1] -262967.28       0.61       0.14       0.22       0.03       0.17
##  [7]       0.10       0.88       0.04       0.53       0.04
##  [1] -262859.40       0.62       0.13       0.22       0.04       0.17
##  [7]       0.10       0.88       0.04       0.54       0.04
##  [1] -262808.62       0.62       0.12       0.22       0.04       0.17
##  [7]       0.10       0.88       0.04       0.54       0.04
##  [1] -262779.47       0.62       0.11       0.22       0.04       0.17
##  [7]       0.10       0.88       0.04       0.55       0.04
##  [1] -262758.20       0.63       0.11       0.22       0.05       0.17
##  [7]       0.10       0.88       0.04       0.55       0.04
##  [1] -262739.49       0.62       0.11       0.22       0.05       0.17
##  [7]       0.10       0.88       0.04       0.55       0.04
##  [1] -262722.20       0.62       0.10       0.22       0.06       0.16
##  [7]       0.10       0.88       0.04       0.56       0.04
##  [1] -262705.72       0.62       0.10       0.22       0.06       0.16
##  [7]       0.10       0.88       0.04       0.56       0.04
##  [1] -262690.48       0.62       0.10       0.22       0.06       0.16
##  [7]       0.09       0.88       0.04       0.56       0.04
##  [1] -262676.98       0.62       0.10       0.22       0.07       0.16
##  [7]       0.09       0.88       0.04       0.56       0.04
##  [1] -262665.76       0.62       0.10       0.22       0.07       0.15
##  [7]       0.09       0.88       0.04       0.56       0.04
##  [1] -262657.20       0.61       0.10       0.22       0.07       0.15
##  [7]       0.08       0.88       0.04       0.57       0.04
ggplot(sampleinfo_organoid_notfetal, aes(as.numeric(as.character(passage.or.rescope.no_numeric)), thresholded_prior_ratio))+
  geom_point(size=2,shape=21,color="black",aes(fill=as.factor(passage.or.rescope.no_numeric)))+xlab("Passage")+
  ylab("Intermediate Peak Prior")+theme_bw()+theme(axis.title = element_text(size=12))+
  #geom_text(aes(label=count, vjust=vjust, hjust=hjust), color="grey40", size=3)+
  scale_x_continuous(breaks=c(1,2,3,4,6,7,8,2,4,10,11,14,16))+ scale_fill_manual(values=pass_col,name="Passage\nNumber", guide=F)

ggsave(here("figs","MTAB4957_mixture_model_ratio_maximize.pdf"), width=3, height=2)


sampleinfo_organoid_notfetal$thresholded_ratio_max<-F
sampleinfo_organoid_notfetal$thresholded_ratio_max[which(sampleinfo_organoid_notfetal$thresholded_prior_ratio>1)]<-T

percent_passing<-round((tapply(sampleinfo_organoid_notfetal$thresholded_ratio_max, sampleinfo_organoid_notfetal$passage.or.rescope.no_numeric, sum)/tapply(sampleinfo_organoid_notfetal$array.id, sampleinfo_organoid_notfetal$passage.or.rescope.no_numeric, length))*100,2)
passed_num<-tapply(sampleinfo_organoid_notfetal$thresholded_ratio_max, sampleinfo_organoid_notfetal$passage.or.rescope.no_numeric, sum)
org_numer<-tapply(sampleinfo_organoid_notfetal$array.id, sampleinfo_organoid_notfetal$passage.or.rescope.no_numeric, length)

df<-data.frame(passage=names(percent_passing), passing=percent_passing, pro_passing=percent_passing/100, count=org_numer, passed_num=passed_num)
df$passage.factor <- factor(df$passage, levels = c(11,9,8,6,4,3,2,1))


df<-cbind(df,(binom.confint(df$passed_num, df$count, method="exact", conf.level=0.95)))
df$upper<-df$upper*100
df$lower<-df$lower*100

print(df)
##    passage passing pro_passing count passed_num passage.factor method x  n
## 1        1       0         0.0     2          0              1  exact 0  2
## 2        2       0         0.0     6          0              2  exact 0  6
## 3        3       0         0.0     1          0              3  exact 0  1
## 4        4       0         0.0     5          0              4  exact 0  5
## 6        6      50         0.5     2          1              6  exact 1  2
## 8        8       0         0.0     2          0              8  exact 0  2
## 9        9       0         0.0     2          0              9  exact 0  2
## 11      11      50         0.5    10          5             11  exact 5 10
##    mean     lower    upper
## 1   0.0  0.000000 84.18861
## 2   0.0  0.000000 45.92581
## 3   0.0  0.000000 97.50000
## 4   0.0  0.000000 52.18238
## 6   0.5  1.257912 98.74209
## 8   0.0  0.000000 84.18861
## 9   0.0  0.000000 84.18861
## 11  0.5 18.708603 81.29140
ggplot(df, aes(as.numeric(as.character(passage)), passing))+
  geom_errorbar(aes(ymin=lower, ymax=upper), colour="grey70", width=.25)+
  geom_line(color="grey20")+geom_point(size=1.25,shape=21,color="black",aes(fill=passage.factor))+xlab("Passage")+
  ylab("Samples with Trimodal\nDistribution (%)")+theme_bw()+theme(axis.title = element_text(size=10))+
  scale_x_continuous(breaks=c(1,2,3,4,6,7,8,2,4,10,11,14,16))+ scale_fill_manual(values=pass_col,name="Passage\nNumber", guide=F)

ggsave(here("figs","MTAB4957_mixture_model_ratio_threshold_maximize.pdf"), width=3, height=2)



## plot all samples
plts_paired<-lapply(1:nrow(sampleinfo_organoid_notfetal), function(x){
  print(x)
  passage<-paste("passage: ",sampleinfo_organoid_notfetal$passage.or.rescope.no_numeric[x],"\nIndividual: ", sampleinfo_organoid_notfetal$Characteristics.individual.[x],"\nRatio I/H: " ,round(sampleinfo_organoid_notfetal$thresholded_prior_ratio[x],2), sep="")
  converted<-as.numeric(round(MTAB4957_beta_VeryVariable[,x]*1000,0))
  counts<-rep(1000, length(converted))
  res = em(converted, counts, .41, .31, .27, 0.01, .1, .1, .90, .03, .5, .05)
  draw_fit_params_gg(converted, counts, res,passage)
})
## [1] 1
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -270103.38       0.60       0.23       0.15       0.02       0.16
##  [7]       0.09       0.87       0.04       0.51       0.05
##  [1] -265610.50       0.65       0.20       0.12       0.03       0.18
##  [7]       0.10       0.85       0.04       0.51       0.04
##  [1] -264849.45       0.66       0.19       0.11       0.04       0.20
##  [7]       0.11       0.84       0.04       0.52       0.04
##  [1] -264579.20       0.67       0.18       0.10       0.04       0.21
##  [7]       0.11       0.83       0.04       0.52       0.04
##  [1] -264483.85       0.67       0.18       0.10       0.05       0.21
##  [7]       0.12       0.83       0.04       0.52       0.04
##  [1] -264462.54       0.67       0.18       0.10       0.05       0.22
##  [7]       0.12       0.82       0.05       0.53       0.04
##  [1] -264472.22       0.67       0.18       0.10       0.06       0.22
##  [7]       0.12       0.82       0.05       0.53       0.04
## [1] 2
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -267948.50       0.57       0.28       0.12       0.02       0.14
##  [7]       0.09       0.87       0.04       0.50       0.05
##  [1] -265150.42       0.62       0.26       0.09       0.03       0.15
##  [7]       0.10       0.85       0.04       0.51       0.04
##  [1] -264649.49       0.64       0.25       0.08       0.04       0.15
##  [7]       0.11       0.84       0.05       0.51       0.04
##  [1] -264426.43       0.64       0.24       0.07       0.04       0.16
##  [7]       0.11       0.83       0.05       0.51       0.04
##  [1] -264304.19       0.65       0.24       0.07       0.05       0.16
##  [7]       0.11       0.82       0.05       0.51       0.04
##  [1] -264228.23       0.65       0.24       0.06       0.05       0.16
##  [7]       0.11       0.82       0.05       0.51       0.04
##  [1] -264174.45       0.64       0.24       0.06       0.06       0.16
##  [7]       0.11       0.81       0.05       0.51       0.04
##  [1] -264131.03       0.64       0.23       0.06       0.06       0.16
##  [7]       0.11       0.81       0.05       0.51       0.04
##  [1] -264091.61       0.64       0.23       0.06       0.07       0.16
##  [7]       0.11       0.80       0.06       0.51       0.04
##  [1] -264052.64       0.63       0.23       0.06       0.07       0.16
##  [7]       0.11       0.80       0.06       0.51       0.04
##  [1] -264012.18       0.63       0.23       0.06       0.08       0.15
##  [7]       0.11       0.80       0.06       0.51       0.04
##  [1] -263969.23       0.63       0.23       0.06       0.08       0.15
##  [7]       0.10       0.79       0.06       0.51       0.04
##  [1] -263923.51       0.62       0.23       0.06       0.08       0.15
##  [7]       0.10       0.79       0.06       0.51       0.04
##  [1] -263875.00       0.62       0.23       0.06       0.09       0.15
##  [7]       0.10       0.79       0.06       0.51       0.05
##  [1] -263824.06       0.61       0.23       0.06       0.09       0.15
##  [7]       0.10       0.79       0.06       0.51       0.05
##  [1] -263771.15       0.61       0.23       0.06       0.09       0.15
##  [7]       0.10       0.79       0.06       0.51       0.05
##  [1] -263716.82       0.61       0.23       0.06       0.10       0.15
##  [7]       0.10       0.79       0.06       0.51       0.05
##  [1] -263661.61       0.60       0.23       0.07       0.10       0.14
##  [7]       0.10       0.79       0.06       0.50       0.05
##  [1] -263606.08       0.60       0.23       0.07       0.10       0.14
##  [7]       0.09       0.79       0.06       0.50       0.05
##  [1] -263550.73       0.59       0.23       0.07       0.11       0.14
##  [7]       0.09       0.79       0.06       0.50       0.05
##  [1] -263496.13       0.59       0.23       0.07       0.11       0.14
##  [7]       0.09       0.79       0.06       0.50       0.05
##  [1] -263442.33       0.59       0.23       0.07       0.11       0.14
##  [7]       0.09       0.79       0.06       0.50       0.06
##  [1] -263389.84       0.58       0.23       0.07       0.12       0.14
##  [7]       0.09       0.79       0.06       0.50       0.06
##  [1] -263338.89       0.58       0.23       0.07       0.12       0.13
##  [7]       0.09       0.79       0.06       0.49       0.06
##  [1] -263289.68       0.57       0.23       0.07       0.12       0.13
##  [7]       0.09       0.79       0.06       0.49       0.06
##  [1] -263242.36       0.57       0.23       0.07       0.13       0.13
##  [7]       0.08       0.79       0.06       0.49       0.06
##  [1] -263197.03       0.57       0.23       0.08       0.13       0.13
##  [7]       0.08       0.79       0.06       0.49       0.06
##  [1] -263153.75       0.56       0.23       0.08       0.13       0.13
##  [7]       0.08       0.79       0.06       0.49       0.06
##  [1] -263112.73       0.56       0.23       0.08       0.14       0.13
##  [7]       0.08       0.79       0.06       0.48       0.06
##  [1] -263073.78       0.55       0.23       0.08       0.14       0.13
##  [7]       0.08       0.79       0.06       0.48       0.06
##  [1] -263036.82       0.55       0.22       0.08       0.14       0.12
##  [7]       0.08       0.79       0.06       0.48       0.07
##  [1] -263002.04       0.55       0.22       0.08       0.15       0.12
##  [7]       0.08       0.79       0.06       0.48       0.07
##  [1] -262969.40       0.54       0.22       0.08       0.15       0.12
##  [7]       0.07       0.79       0.06       0.47       0.07
##  [1] -262938.87       0.54       0.22       0.08       0.16       0.12
##  [7]       0.07       0.79       0.07       0.47       0.07
##  [1] -262910.43       0.53       0.22       0.09       0.16       0.12
##  [7]       0.07       0.79       0.07       0.47       0.07
##  [1] -262884.05       0.53       0.22       0.09       0.16       0.12
##  [7]       0.07       0.79       0.07       0.47       0.07
##  [1] -262859.71       0.53       0.22       0.09       0.17       0.11
##  [7]       0.07       0.79       0.07       0.47       0.07
##  [1] -262837.35       0.52       0.22       0.09       0.17       0.11
##  [7]       0.07       0.79       0.07       0.46       0.07
##  [1] -262816.93       0.52       0.22       0.09       0.17       0.11
##  [7]       0.06       0.79       0.07       0.46       0.07
##  [1] -262798.47       0.51       0.22       0.09       0.18       0.11
##  [7]       0.06       0.79       0.07       0.46       0.08
##  [1] -262782.05       0.51       0.22       0.09       0.18       0.11
##  [7]       0.06       0.79       0.07       0.46       0.08
##  [1] -262767.53       0.50       0.21       0.10       0.19       0.11
##  [7]       0.06       0.79       0.07       0.46       0.08
##  [1] -262754.77       0.50       0.21       0.10       0.19       0.11
##  [7]       0.06       0.79       0.07       0.45       0.08
##  [1] -262743.78       0.50       0.21       0.10       0.19       0.10
##  [7]       0.06       0.79       0.07       0.45       0.08
##  [1] -262734.60       0.49       0.21       0.10       0.20       0.10
##  [7]       0.06       0.79       0.07       0.45       0.08
## [1] 3
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -265933.53       0.55       0.26       0.16       0.02       0.14
##  [7]       0.08       0.89       0.04       0.51       0.04
##  [1] -263730.92       0.60       0.24       0.13       0.03       0.14
##  [7]       0.08       0.88       0.05       0.51       0.04
##  [1] -263609.69       0.62       0.23       0.12       0.04       0.14
##  [7]       0.07       0.88       0.05       0.51       0.04
##  [1] -263566.97       0.64       0.21       0.11       0.04       0.13
##  [7]       0.07       0.88       0.05       0.51       0.04
##  [1] -263529.40       0.64       0.20       0.10       0.05       0.13
##  [7]       0.06       0.88       0.05       0.51       0.04
##  [1] -263491.42       0.65       0.20       0.10       0.06       0.12
##  [7]       0.06       0.88       0.05       0.51       0.04
##  [1] -263454.75       0.65       0.19       0.09       0.07       0.12
##  [7]       0.05       0.88       0.05       0.51       0.04
##  [1] -263426.41       0.65       0.19       0.09       0.07       0.11
##  [7]       0.04       0.88       0.05       0.51       0.04
##  [1] -263411.13       0.65       0.18       0.09       0.08       0.10
##  [7]       0.04       0.88       0.05       0.51       0.04
##  [1] -263413.40       0.65       0.18       0.09       0.08       0.10
##  [7]       0.03       0.88       0.04       0.51       0.04
## [1] 4
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -268327.69       0.57       0.27       0.13       0.02       0.14
##  [7]       0.08       0.88       0.04       0.50       0.05
##  [1] -265055.63       0.62       0.26       0.10       0.03       0.15
##  [7]       0.09       0.86       0.05       0.51       0.04
##  [1] -264657.68       0.64       0.25       0.08       0.04       0.16
##  [7]       0.09       0.85       0.05       0.51       0.04
##  [1] -264483.42       0.64       0.24       0.07       0.04       0.16
##  [7]       0.09       0.85       0.05       0.51       0.04
##  [1] -264375.78       0.65       0.23       0.07       0.05       0.16
##  [7]       0.09       0.84       0.06       0.51       0.04
##  [1] -264295.85       0.65       0.23       0.06       0.06       0.16
##  [7]       0.09       0.83       0.06       0.51       0.04
##  [1] -264228.76       0.65       0.23       0.06       0.06       0.16
##  [7]       0.09       0.83       0.06       0.51       0.04
##  [1] -264167.37       0.65       0.23       0.06       0.07       0.16
##  [7]       0.09       0.83       0.06       0.51       0.04
##  [1] -264108.90       0.64       0.23       0.06       0.07       0.16
##  [7]       0.09       0.82       0.06       0.51       0.04
##  [1] -264051.78       0.64       0.23       0.06       0.07       0.16
##  [7]       0.09       0.82       0.06       0.51       0.04
##  [1] -263995.16       0.64       0.23       0.06       0.08       0.16
##  [7]       0.09       0.82       0.06       0.51       0.04
##  [1] -263938.68       0.64       0.22       0.06       0.08       0.15
##  [7]       0.08       0.82       0.06       0.51       0.04
##  [1] -263882.45       0.63       0.22       0.06       0.08       0.15
##  [7]       0.08       0.82       0.07       0.51       0.04
##  [1] -263826.28       0.63       0.22       0.06       0.09       0.15
##  [7]       0.08       0.81       0.07       0.51       0.05
##  [1] -263770.51       0.63       0.22       0.06       0.09       0.15
##  [7]       0.08       0.81       0.07       0.51       0.05
##  [1] -263715.49       0.62       0.22       0.06       0.09       0.15
##  [7]       0.08       0.81       0.07       0.51       0.05
##  [1] -263661.54       0.62       0.22       0.06       0.10       0.15
##  [7]       0.08       0.81       0.07       0.51       0.05
##  [1] -263609.02       0.62       0.22       0.06       0.10       0.15
##  [7]       0.08       0.81       0.07       0.51       0.05
##  [1] -263558.22       0.61       0.22       0.06       0.10       0.14
##  [7]       0.07       0.81       0.07       0.50       0.05
##  [1] -263509.50       0.61       0.22       0.06       0.11       0.14
##  [7]       0.07       0.81       0.07       0.50       0.05
##  [1] -263462.88       0.61       0.22       0.06       0.11       0.14
##  [7]       0.07       0.81       0.07       0.50       0.05
##  [1] -263418.64       0.60       0.22       0.07       0.11       0.14
##  [7]       0.07       0.81       0.07       0.50       0.06
##  [1] -263376.90       0.60       0.22       0.07       0.12       0.14
##  [7]       0.07       0.81       0.07       0.50       0.06
##  [1] -263337.76       0.59       0.22       0.07       0.12       0.14
##  [7]       0.07       0.81       0.07       0.49       0.06
##  [1] -263301.26       0.59       0.22       0.07       0.13       0.13
##  [7]       0.07       0.81       0.07       0.49       0.06
##  [1] -263267.41       0.59       0.22       0.07       0.13       0.13
##  [7]       0.06       0.81       0.07       0.49       0.06
##  [1] -263236.20       0.58       0.21       0.07       0.13       0.13
##  [7]       0.06       0.81       0.07       0.49       0.06
##  [1] -263207.60       0.58       0.21       0.07       0.14       0.13
##  [7]       0.06       0.81       0.07       0.49       0.06
##  [1] -263181.58       0.58       0.21       0.07       0.14       0.13
##  [7]       0.06       0.81       0.07       0.48       0.07
##  [1] -263158.07       0.57       0.21       0.07       0.14       0.13
##  [7]       0.06       0.81       0.07       0.48       0.07
##  [1] -263137.02       0.57       0.21       0.07       0.15       0.13
##  [7]       0.06       0.81       0.07       0.48       0.07
##  [1] -263118.37       0.56       0.21       0.08       0.15       0.12
##  [7]       0.06       0.81       0.07       0.48       0.07
##  [1] -263102.03       0.56       0.21       0.08       0.15       0.12
##  [7]       0.06       0.81       0.07       0.48       0.07
##  [1] -263087.93       0.56       0.21       0.08       0.16       0.12
##  [7]       0.05       0.81       0.07       0.47       0.07
##  [1] -263076.02       0.55       0.21       0.08       0.16       0.12
##  [7]       0.05       0.81       0.07       0.47       0.07
##  [1] -263066.20       0.55       0.21       0.08       0.17       0.12
##  [7]       0.05       0.81       0.07       0.47       0.07
## [1] 5
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -263896.17       0.53       0.28       0.17       0.02       0.13
##  [7]       0.08       0.89       0.03       0.51       0.04
##  [1] -262305.00       0.57       0.26       0.15       0.03       0.13
##  [7]       0.08       0.88       0.03       0.51       0.04
##  [1] -262396.01       0.59       0.25       0.13       0.04       0.13
##  [7]       0.08       0.88       0.03       0.52       0.03
##  [1] -262563.43       0.60       0.24       0.12       0.04       0.12
##  [7]       0.07       0.88       0.03       0.52       0.03
##  [1] -262741.61       0.60       0.23       0.12       0.05       0.12
##  [7]       0.07       0.89       0.03       0.52       0.03
##  [1] -262910.45       0.60       0.23       0.11       0.06       0.12
##  [7]       0.06       0.89       0.03       0.52       0.03
##  [1] -263061.11       0.60       0.22       0.11       0.07       0.11
##  [7]       0.06       0.89       0.03       0.52       0.03
##  [1] -263187.95       0.60       0.22       0.11       0.07       0.11
##  [7]       0.05       0.89       0.02       0.52       0.03
##  [1] -263288.70       0.60       0.21       0.11       0.08       0.11
##  [7]       0.05       0.89       0.02       0.52       0.03
##  [1] -263365.51       0.60       0.21       0.11       0.08       0.10
##  [7]       0.05       0.89       0.02       0.52       0.03
##  [1] -263418.72       0.60       0.21       0.11       0.08       0.10
##  [7]       0.05       0.89       0.02       0.52       0.03
##  [1] -263453.60       0.60       0.21       0.11       0.09       0.10
##  [7]       0.04       0.89       0.02       0.52       0.03
##  [1] -263473.93       0.60       0.21       0.11       0.09       0.10
##  [7]       0.04       0.90       0.02       0.52       0.03
##  [1] -263482.87       0.60       0.20       0.10       0.09       0.09
##  [7]       0.04       0.90       0.02       0.52       0.03
## [1] 6
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -262708.15       0.52       0.31       0.15       0.02       0.12
##  [7]       0.08       0.89       0.03       0.51       0.04
##  [1] -261310.86       0.55       0.30       0.12       0.03       0.11
##  [7]       0.07       0.89       0.03       0.51       0.03
##  [1] -261345.87       0.57       0.29       0.10       0.04       0.11
##  [7]       0.06       0.89       0.03       0.51       0.03
##  [1] -261458.68       0.58       0.28       0.09       0.05       0.10
##  [7]       0.05       0.89       0.03       0.51       0.03
##  [1] -261604.18       0.59       0.27       0.09       0.06       0.09
##  [7]       0.04       0.90       0.03       0.51       0.03
##  [1] -261760.99       0.59       0.26       0.08       0.07       0.09
##  [7]       0.04       0.90       0.02       0.51       0.03
##  [1] -261915.76       0.59       0.25       0.08       0.07       0.08
##  [7]       0.03       0.90       0.02       0.51       0.03
##  [1] -262059.79       0.60       0.25       0.08       0.08       0.08
##  [7]       0.03       0.90       0.02       0.51       0.03
##  [1] -262188.71       0.60       0.24       0.08       0.08       0.08
##  [7]       0.02       0.91       0.02       0.51       0.03
##  [1] -262301.69       0.60       0.24       0.07       0.09       0.07
##  [7]       0.02       0.91       0.02       0.51       0.03
##  [1] -262398.35       0.60       0.24       0.07       0.09       0.07
##  [7]       0.02       0.91       0.02       0.51       0.03
##  [1] -262478.14       0.60       0.23       0.07       0.09       0.07
##  [7]       0.02       0.91       0.02       0.51       0.03
##  [1] -262540.98       0.61       0.23       0.07       0.09       0.07
##  [7]       0.02       0.91       0.01       0.51       0.04
##  [1] -262587.79       0.61       0.23       0.07       0.10       0.07
##  [7]       0.02       0.91       0.01       0.51       0.04
##  [1] -262620.34       0.61       0.23       0.07       0.10       0.07
##  [7]       0.02       0.91       0.01       0.50       0.04
##  [1] -262640.65       0.61       0.22       0.07       0.10       0.07
##  [7]       0.02       0.91       0.01       0.50       0.04
##  [1] -262650.63       0.61       0.22       0.07       0.10       0.07
##  [7]       0.02       0.91       0.01       0.50       0.04
## [1] 7
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -266156.99       0.55       0.23       0.20       0.02       0.14
##  [7]       0.09       0.89       0.04       0.51       0.05
##  [1] -263918.14       0.60       0.20       0.17       0.03       0.15
##  [7]       0.09       0.88       0.04       0.52       0.04
##  [1] -263719.46       0.62       0.19       0.16       0.03       0.16
##  [7]       0.09       0.88       0.04       0.52       0.04
##  [1] -263668.00       0.63       0.18       0.15       0.04       0.16
##  [7]       0.09       0.87       0.04       0.53       0.04
##  [1] -263651.32       0.64       0.17       0.15       0.04       0.16
##  [7]       0.09       0.87       0.04       0.53       0.04
##  [1] -263643.44       0.64       0.16       0.15       0.05       0.15
##  [7]       0.09       0.87       0.04       0.54       0.04
## [1] 8
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269727.89       0.59       0.24       0.15       0.02       0.16
##  [7]       0.09       0.87       0.04       0.50       0.05
##  [1] -265787.44       0.64       0.22       0.11       0.03       0.17
##  [7]       0.10       0.86       0.05       0.51       0.04
##  [1] -265125.41       0.66       0.21       0.10       0.04       0.19
##  [7]       0.10       0.85       0.05       0.51       0.04
##  [1] -264875.78       0.67       0.20       0.09       0.04       0.19
##  [7]       0.11       0.84       0.05       0.52       0.04
##  [1] -264777.19       0.67       0.20       0.09       0.05       0.20
##  [7]       0.11       0.83       0.06       0.52       0.04
##  [1] -264745.47       0.67       0.20       0.09       0.05       0.20
##  [7]       0.11       0.82       0.06       0.52       0.04
##  [1] -264743.71       0.67       0.19       0.08       0.05       0.21
##  [7]       0.12       0.82       0.06       0.52       0.04
## [1] 9
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269947.47       0.59       0.23       0.16       0.02       0.16
##  [7]       0.09       0.87       0.03       0.51       0.05
##  [1] -264782.87       0.63       0.20       0.14       0.03       0.17
##  [7]       0.09       0.85       0.03       0.52       0.04
##  [1] -264002.79       0.65       0.18       0.13       0.03       0.18
##  [7]       0.09       0.84       0.04       0.53       0.04
##  [1] -263744.75       0.66       0.17       0.13       0.04       0.19
##  [7]       0.10       0.83       0.04       0.53       0.04
##  [1] -263658.77       0.66       0.17       0.13       0.05       0.19
##  [7]       0.10       0.83       0.04       0.54       0.04
##  [1] -263640.91       0.66       0.17       0.13       0.05       0.19
##  [7]       0.10       0.82       0.04       0.54       0.04
##  [1] -263649.12       0.65       0.16       0.13       0.06       0.19
##  [7]       0.10       0.82       0.04       0.54       0.04
## [1] 10
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269866.23       0.59       0.25       0.14       0.02       0.15
##  [7]       0.09       0.86       0.03       0.51       0.05
##  [1] -265019.48       0.63       0.22       0.11       0.03       0.17
##  [7]       0.09       0.85       0.04       0.51       0.04
##  [1] -264281.88       0.65       0.21       0.10       0.04       0.17
##  [7]       0.09       0.83       0.04       0.52       0.04
##  [1] -264016.70       0.66       0.20       0.10       0.04       0.18
##  [7]       0.10       0.83       0.04       0.52       0.04
##  [1] -263913.05       0.66       0.20       0.10       0.05       0.18
##  [7]       0.10       0.82       0.04       0.53       0.04
##  [1] -263876.53       0.66       0.19       0.10       0.06       0.18
##  [7]       0.10       0.81       0.04       0.53       0.04
##  [1] -263867.28       0.65       0.19       0.10       0.06       0.18
##  [7]       0.10       0.81       0.04       0.53       0.04
## [1] 11
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269220.74       0.58       0.24       0.16       0.02       0.15
##  [7]       0.09       0.86       0.03       0.51       0.05
##  [1] -264457.82       0.62       0.22       0.13       0.03       0.16
##  [7]       0.09       0.85       0.03       0.52       0.04
##  [1] -263816.32       0.64       0.20       0.12       0.03       0.17
##  [7]       0.09       0.84       0.03       0.52       0.04
##  [1] -263619.25       0.64       0.20       0.12       0.04       0.17
##  [7]       0.09       0.83       0.03       0.53       0.04
##  [1] -263555.15       0.64       0.19       0.12       0.05       0.17
##  [7]       0.09       0.83       0.04       0.53       0.04
##  [1] -263537.61       0.64       0.19       0.12       0.05       0.17
##  [7]       0.09       0.82       0.04       0.53       0.04
##  [1] -263535.21       0.64       0.19       0.12       0.06       0.17
##  [7]       0.09       0.82       0.04       0.53       0.04
## [1] 12
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269547.80       0.58       0.26       0.14       0.02       0.14
##  [7]       0.09       0.86       0.03       0.51       0.05
##  [1] -264712.75       0.62       0.24       0.11       0.03       0.16
##  [7]       0.09       0.84       0.03       0.52       0.04
##  [1] -263961.59       0.64       0.22       0.10       0.04       0.16
##  [7]       0.09       0.83       0.03       0.52       0.04
##  [1] -263706.98       0.65       0.22       0.10       0.04       0.16
##  [7]       0.09       0.82       0.04       0.53       0.04
##  [1] -263619.22       0.65       0.21       0.09       0.05       0.16
##  [7]       0.09       0.81       0.04       0.53       0.04
##  [1] -263597.40       0.64       0.21       0.09       0.05       0.16
##  [7]       0.09       0.81       0.04       0.53       0.04
##  [1] -263600.38       0.64       0.21       0.09       0.06       0.16
##  [7]       0.09       0.80       0.04       0.53       0.04
## [1] 13
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -259769.23       0.48       0.32       0.18       0.02       0.11
##  [7]       0.07       0.90       0.03       0.51       0.03
##  [1] -258078.74       0.50       0.31       0.16       0.03       0.10
##  [7]       0.05       0.90       0.03       0.52       0.03
##  [1] -257929.05       0.51       0.30       0.14       0.04       0.10
##  [7]       0.05       0.90       0.03       0.53       0.02
##  [1] -258104.90       0.52       0.30       0.14       0.05       0.09
##  [7]       0.04       0.91       0.03       0.53       0.02
##  [1] -258378.48       0.51       0.29       0.13       0.06       0.09
##  [7]       0.04       0.91       0.02       0.53       0.02
##  [1] -258619.09       0.51       0.29       0.13       0.07       0.08
##  [7]       0.03       0.91       0.02       0.53       0.01
##  [1] -258783.69       0.50       0.28       0.13       0.08       0.08
##  [7]       0.03       0.91       0.02       0.53       0.01
##  [1] -258876.56       0.50       0.28       0.13       0.09       0.08
##  [7]       0.03       0.91       0.02       0.53       0.02
##  [1] -258911.89       0.49       0.28       0.13       0.09       0.08
##  [7]       0.03       0.91       0.02       0.53       0.02
##  [1] -258909.71       0.49       0.28       0.13       0.10       0.08
##  [7]       0.03       0.91       0.02       0.53       0.02
## [1] 14
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -259752.33       0.48       0.30       0.21       0.02       0.11
##  [7]       0.07       0.90       0.03       0.52       0.04
##  [1] -257997.02       0.50       0.29       0.19       0.02       0.11
##  [7]       0.05       0.90       0.03       0.53       0.03
##  [1] -257877.11       0.51       0.28       0.18       0.03       0.10
##  [7]       0.05       0.91       0.03       0.53       0.02
##  [1] -258059.72       0.52       0.27       0.17       0.05       0.10
##  [7]       0.04       0.91       0.02       0.54       0.02
##  [1] -258347.34       0.52       0.26       0.17       0.06       0.09
##  [7]       0.03       0.91       0.02       0.54       0.02
##  [1] -258622.45       0.51       0.26       0.16       0.07       0.09
##  [7]       0.03       0.91       0.02       0.54       0.02
##  [1] -258836.89       0.51       0.25       0.16       0.07       0.09
##  [7]       0.03       0.91       0.02       0.54       0.01
##  [1] -258972.88       0.51       0.25       0.16       0.08       0.09
##  [7]       0.03       0.91       0.02       0.54       0.01
##  [1] -259051.97       0.50       0.25       0.16       0.08       0.08
##  [7]       0.03       0.91       0.02       0.54       0.01
##  [1] -259083.13       0.50       0.25       0.16       0.09       0.08
##  [7]       0.03       0.91       0.02       0.54       0.02
##  [1] -259088.87       0.50       0.25       0.16       0.09       0.08
##  [7]       0.03       0.91       0.02       0.55       0.02
## [1] 15
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -259682.08       0.48       0.32       0.19       0.02       0.11
##  [7]       0.06       0.90       0.03       0.52       0.03
##  [1] -257554.74       0.50       0.31       0.16       0.03       0.10
##  [7]       0.05       0.90       0.03       0.53       0.03
##  [1] -257281.93       0.51       0.31       0.15       0.04       0.09
##  [7]       0.04       0.91       0.03       0.53       0.02
##  [1] -257424.24       0.51       0.30       0.14       0.05       0.09
##  [7]       0.03       0.91       0.03       0.54       0.02
##  [1] -257696.08       0.51       0.29       0.14       0.06       0.09
##  [7]       0.03       0.91       0.02       0.54       0.02
##  [1] -257947.97       0.50       0.29       0.14       0.07       0.08
##  [7]       0.03       0.91       0.02       0.54       0.01
##  [1] -258121.06       0.49       0.29       0.14       0.08       0.08
##  [7]       0.03       0.91       0.02       0.54       0.01
##  [1] -258214.98       0.49       0.28       0.14       0.09       0.08
##  [7]       0.03       0.91       0.02       0.54       0.01
##  [1] -258247.70       0.49       0.28       0.14       0.09       0.08
##  [7]       0.03       0.91       0.02       0.54       0.01
##  [1] -258245.26       0.48       0.28       0.14       0.10       0.08
##  [7]       0.03       0.91       0.02       0.55       0.01
## [1] 16
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -267714.39       0.56       0.23       0.20       0.02       0.16
##  [7]       0.08       0.89       0.04       0.51       0.05
##  [1] -263840.55       0.59       0.21       0.17       0.02       0.17
##  [7]       0.07       0.88       0.04       0.52       0.04
##  [1] -263510.94       0.61       0.20       0.16       0.03       0.17
##  [7]       0.07       0.88       0.04       0.53       0.04
##  [1] -263426.83       0.62       0.19       0.15       0.04       0.17
##  [7]       0.07       0.87       0.05       0.53       0.04
##  [1] -263404.13       0.63       0.18       0.15       0.04       0.17
##  [7]       0.07       0.87       0.05       0.54       0.04
##  [1] -263402.99       0.63       0.18       0.15       0.04       0.17
##  [7]       0.07       0.87       0.05       0.54       0.04
## [1] 17
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -253828.02       0.42       0.34       0.22       0.01       0.09
##  [7]       0.05       0.92       0.03       0.53       0.03
##  [1] -249506.73       0.43       0.35       0.21       0.02       0.07
##  [7]       0.03       0.93       0.02       0.54       0.02
##  [1] -247643.30       0.42       0.34       0.20       0.04       0.06
##  [7]       0.02       0.93       0.02       0.54       0.02
##  [1] -247096.75       0.42       0.33       0.20       0.05       0.06
##  [7]       0.02       0.93       0.01       0.55       0.01
##  [1] -247104.69       0.41       0.33       0.19       0.07       0.06
##  [7]       0.02       0.93       0.01       0.55       0.01
## [1] 18
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -268311.76       0.56       0.26       0.16       0.02       0.14
##  [7]       0.08       0.87       0.04       0.51       0.05
##  [1] -264655.97       0.60       0.24       0.13       0.03       0.15
##  [7]       0.08       0.86       0.05       0.52       0.05
##  [1] -264080.51       0.62       0.23       0.12       0.03       0.15
##  [7]       0.08       0.85       0.05       0.52       0.04
##  [1] -263871.65       0.63       0.22       0.11       0.04       0.15
##  [7]       0.08       0.84       0.05       0.53       0.04
##  [1] -263795.56       0.64       0.21       0.11       0.04       0.15
##  [7]       0.08       0.83       0.05       0.53       0.04
##  [1] -263775.52       0.64       0.21       0.11       0.04       0.15
##  [7]       0.08       0.83       0.05       0.53       0.04
##  [1] -263777.36       0.64       0.20       0.11       0.05       0.15
##  [7]       0.08       0.82       0.06       0.53       0.04
## [1] 19
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -254974.48       0.43       0.34       0.22       0.01       0.09
##  [7]       0.05       0.92       0.03       0.53       0.03
##  [1] -250206.20       0.43       0.34       0.21       0.02       0.08
##  [7]       0.03       0.93       0.02       0.54       0.02
##  [1] -248591.60       0.43       0.34       0.20       0.03       0.07
##  [7]       0.02       0.93       0.02       0.55       0.01
##  [1] -248222.35       0.42       0.33       0.20       0.05       0.07
##  [7]       0.02       0.93       0.02       0.55       0.01
##  [1] -248282.61       0.41       0.33       0.19       0.07       0.07
##  [7]       0.02       0.94       0.01       0.56       0.01
##  [1] -248417.01       0.40       0.32       0.19       0.08       0.06
##  [7]       0.02       0.94       0.01       0.56       0.01
##  [1] -248490.51       0.40       0.32       0.19       0.09       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248504.56       0.39       0.32       0.19       0.09       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248483.83       0.39       0.32       0.19       0.09       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248447.40       0.39       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248407.71       0.39       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248374.19       0.38       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248340.00       0.38       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248309.41       0.38       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248282.71       0.38       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248259.42       0.38       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248239.13       0.38       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248221.50       0.38       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248206.19       0.38       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248192.91       0.37       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248181.34       0.37       0.32       0.20       0.10       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248171.27       0.37       0.32       0.20       0.11       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
##  [1] -248166.53       0.37       0.32       0.20       0.11       0.06
##  [7]       0.01       0.94       0.01       0.56       0.01
## [1] 20
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -268423.74       0.56       0.26       0.16       0.02       0.15
##  [7]       0.08       0.88       0.04       0.51       0.05
##  [1] -264539.44       0.60       0.24       0.14       0.02       0.15
##  [7]       0.08       0.86       0.05       0.51       0.05
##  [1] -264042.09       0.62       0.23       0.13       0.03       0.16
##  [7]       0.08       0.85       0.05       0.52       0.04
##  [1] -263869.42       0.63       0.22       0.12       0.03       0.16
##  [7]       0.08       0.85       0.05       0.52       0.04
##  [1] -263802.11       0.63       0.22       0.12       0.04       0.16
##  [7]       0.08       0.84       0.05       0.53       0.04
##  [1] -263777.83       0.63       0.21       0.12       0.04       0.16
##  [7]       0.07       0.84       0.06       0.53       0.04
##  [1] -263770.78       0.63       0.21       0.11       0.04       0.15
##  [7]       0.07       0.83       0.06       0.53       0.04
## [1] 21
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269112.94       0.57       0.19       0.22       0.02       0.19
##  [7]       0.06       0.90       0.04       0.50       0.05
##  [1] -262778.77       0.60       0.18       0.19       0.02       0.21
##  [7]       0.06       0.90       0.05       0.51       0.04
##  [1] -262363.69       0.61       0.18       0.18       0.03       0.21
##  [7]       0.05       0.90       0.05       0.52       0.04
##  [1] -262336.88       0.62       0.17       0.17       0.04       0.22
##  [7]       0.05       0.90       0.05       0.52       0.04
##  [1] -262368.78       0.62       0.17       0.17       0.04       0.22
##  [7]       0.05       0.90       0.05       0.53       0.04
##  [1] -262403.04       0.62       0.17       0.17       0.05       0.22
##  [7]       0.05       0.90       0.05       0.53       0.04
##  [1] -262427.84       0.61       0.17       0.17       0.05       0.22
##  [7]       0.05       0.90       0.04       0.53       0.04
##  [1] -262440.14       0.61       0.17       0.16       0.06       0.22
##  [7]       0.04       0.90       0.04       0.54       0.04
##  [1] -262439.94       0.61       0.17       0.16       0.06       0.22
##  [7]       0.04       0.90       0.04       0.54       0.04
## [1] 22
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -268870.79       0.57       0.22       0.20       0.02       0.15
##  [7]       0.08       0.88       0.04       0.51       0.05
##  [1] -264530.76       0.61       0.19       0.17       0.02       0.17
##  [7]       0.08       0.86       0.04       0.52       0.05
##  [1] -263860.41       0.63       0.18       0.17       0.03       0.17
##  [7]       0.08       0.85       0.04       0.53       0.05
##  [1] -263641.49       0.63       0.17       0.16       0.03       0.18
##  [7]       0.08       0.85       0.05       0.54       0.04
##  [1] -263574.84       0.64       0.16       0.16       0.04       0.18
##  [7]       0.08       0.84       0.05       0.54       0.04
##  [1] -263567.63       0.64       0.16       0.16       0.04       0.18
##  [7]       0.08       0.84       0.05       0.55       0.04
## [1] 23
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -266085.21       0.54       0.26       0.18       0.02       0.14
##  [7]       0.08       0.89       0.04       0.51       0.05
##  [1] -263573.37       0.58       0.24       0.16       0.02       0.14
##  [7]       0.08       0.89       0.05       0.51       0.04
##  [1] -263440.72       0.60       0.23       0.14       0.03       0.14
##  [7]       0.07       0.88       0.05       0.51       0.04
##  [1] -263412.54       0.61       0.22       0.14       0.03       0.14
##  [7]       0.07       0.88       0.05       0.52       0.04
##  [1] -263398.10       0.62       0.21       0.13       0.04       0.14
##  [7]       0.07       0.88       0.05       0.52       0.04
##  [1] -263384.48       0.62       0.21       0.13       0.04       0.14
##  [7]       0.07       0.88       0.05       0.52       0.04
##  [1] -263368.42       0.63       0.20       0.12       0.04       0.13
##  [7]       0.06       0.88       0.05       0.52       0.04
##  [1] -263350.22       0.63       0.20       0.12       0.05       0.13
##  [7]       0.06       0.88       0.05       0.52       0.04
##  [1] -263330.28       0.63       0.20       0.12       0.05       0.12
##  [7]       0.06       0.88       0.05       0.52       0.04
##  [1] -263309.02       0.63       0.19       0.12       0.05       0.12
##  [7]       0.05       0.89       0.05       0.52       0.05
##  [1] -263286.73       0.63       0.19       0.12       0.06       0.12
##  [7]       0.05       0.89       0.05       0.51       0.05
##  [1] -263264.21       0.64       0.19       0.12       0.06       0.12
##  [7]       0.05       0.89       0.05       0.51       0.05
##  [1] -263242.66       0.64       0.18       0.12       0.06       0.11
##  [7]       0.05       0.89       0.05       0.51       0.05
##  [1] -263222.78       0.64       0.18       0.12       0.06       0.11
##  [7]       0.04       0.89       0.05       0.51       0.05
##  [1] -263205.56       0.64       0.18       0.11       0.07       0.11
##  [7]       0.04       0.89       0.05       0.51       0.06
##  [1] -263191.81       0.64       0.18       0.11       0.07       0.11
##  [7]       0.04       0.89       0.04       0.51       0.06
##  [1] -263182.23       0.64       0.17       0.11       0.07       0.10
##  [7]       0.04       0.89       0.04       0.50       0.06
## [1] 24
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -267783.99       0.55       0.24       0.19       0.02       0.14
##  [7]       0.08       0.88       0.04       0.51       0.05
##  [1] -264335.74       0.59       0.22       0.17       0.02       0.15
##  [7]       0.08       0.86       0.04       0.52       0.05
##  [1] -263835.02       0.61       0.20       0.16       0.03       0.16
##  [7]       0.09       0.86       0.05       0.53       0.05
##  [1] -263676.17       0.62       0.19       0.16       0.03       0.16
##  [7]       0.09       0.85       0.05       0.53       0.04
##  [1] -263627.80       0.62       0.19       0.15       0.03       0.16
##  [7]       0.08       0.85       0.05       0.53       0.04
##  [1] -263621.63       0.63       0.18       0.15       0.04       0.16
##  [7]       0.08       0.84       0.05       0.54       0.04
## [1] 25
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -267731.20       0.56       0.23       0.19       0.02       0.15
##  [7]       0.09       0.88       0.04       0.51       0.05
##  [1] -264708.30       0.61       0.20       0.16       0.03       0.17
##  [7]       0.10       0.87       0.04       0.51       0.04
##  [1] -264313.02       0.63       0.19       0.15       0.03       0.17
##  [7]       0.10       0.86       0.04       0.51       0.04
##  [1] -264195.99       0.64       0.18       0.14       0.04       0.18
##  [7]       0.11       0.86       0.04       0.52       0.04
##  [1] -264157.86       0.64       0.18       0.14       0.04       0.18
##  [7]       0.11       0.85       0.05       0.52       0.04
##  [1] -264144.75       0.64       0.17       0.14       0.04       0.19
##  [7]       0.11       0.85       0.05       0.52       0.04
##  [1] -264137.49       0.65       0.17       0.14       0.05       0.19
##  [7]       0.11       0.85       0.05       0.52       0.04
## [1] 26
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269373.79       0.57       0.23       0.18       0.02       0.16
##  [7]       0.09       0.87       0.03       0.51       0.05
##  [1] -264818.67       0.61       0.21       0.15       0.02       0.18
##  [7]       0.09       0.86       0.04       0.51       0.05
##  [1] -264208.75       0.63       0.20       0.14       0.03       0.19
##  [7]       0.09       0.85       0.04       0.52       0.05
##  [1] -264018.42       0.64       0.19       0.14       0.03       0.19
##  [7]       0.09       0.85       0.04       0.52       0.05
##  [1] -263950.31       0.64       0.19       0.13       0.04       0.20
##  [7]       0.10       0.84       0.04       0.52       0.05
##  [1] -263926.62       0.64       0.19       0.13       0.04       0.20
##  [7]       0.10       0.84       0.04       0.53       0.05
##  [1] -263920.06       0.64       0.19       0.13       0.04       0.20
##  [7]       0.10       0.84       0.04       0.53       0.05
## [1] 27
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -269824.44       0.58       0.22       0.18       0.02       0.16
##  [7]       0.08       0.87       0.03       0.51       0.05
##  [1] -264468.03       0.61       0.20       0.16       0.02       0.18
##  [7]       0.08       0.86       0.03       0.51       0.05
##  [1] -263797.43       0.63       0.19       0.15       0.03       0.19
##  [7]       0.08       0.85       0.04       0.52       0.05
##  [1] -263601.03       0.64       0.19       0.15       0.03       0.20
##  [7]       0.08       0.85       0.04       0.53       0.05
##  [1] -263538.19       0.64       0.18       0.14       0.04       0.20
##  [7]       0.09       0.84       0.04       0.53       0.05
##  [1] -263523.40       0.64       0.18       0.14       0.04       0.21
##  [7]       0.09       0.84       0.04       0.54       0.05
##  [1] -263527.43       0.63       0.18       0.14       0.04       0.21
##  [7]       0.09       0.84       0.04       0.54       0.05
## [1] 28
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -266204.55       0.54       0.29       0.15       0.02       0.13
##  [7]       0.08       0.88       0.03       0.51       0.05
##  [1] -263710.54       0.58       0.27       0.12       0.03       0.14
##  [7]       0.08       0.87       0.04       0.51       0.04
##  [1] -263504.80       0.60       0.26       0.10       0.03       0.14
##  [7]       0.08       0.86       0.04       0.52       0.04
##  [1] -263452.41       0.61       0.25       0.09       0.04       0.13
##  [7]       0.08       0.86       0.04       0.52       0.04
##  [1] -263434.00       0.62       0.25       0.09       0.05       0.13
##  [7]       0.08       0.86       0.04       0.52       0.04
##  [1] -263424.67       0.62       0.24       0.09       0.05       0.13
##  [7]       0.07       0.86       0.04       0.53       0.04
## [1] 29
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -267788.65       0.56       0.25       0.17       0.02       0.14
##  [7]       0.09       0.88       0.04       0.51       0.05
##  [1] -264511.04       0.60       0.23       0.14       0.02       0.15
##  [7]       0.09       0.87       0.04       0.51       0.05
##  [1] -264073.57       0.62       0.22       0.13       0.03       0.16
##  [7]       0.09       0.86       0.04       0.52       0.05
##  [1] -263913.12       0.63       0.21       0.13       0.03       0.16
##  [7]       0.09       0.85       0.05       0.52       0.04
##  [1] -263840.55       0.63       0.21       0.12       0.04       0.16
##  [7]       0.09       0.85       0.05       0.53       0.04
##  [1] -263804.20       0.63       0.20       0.12       0.04       0.16
##  [7]       0.09       0.84       0.05       0.53       0.04
##  [1] -263783.55       0.63       0.20       0.12       0.04       0.16
##  [7]       0.09       0.84       0.05       0.53       0.04
##  [1] -263769.56       0.63       0.20       0.12       0.05       0.16
##  [7]       0.09       0.84       0.05       0.53       0.04
##  [1] -263757.04       0.63       0.20       0.12       0.05       0.16
##  [7]       0.09       0.84       0.05       0.54       0.05
##  [1] -263743.71       0.63       0.20       0.12       0.05       0.15
##  [7]       0.09       0.84       0.05       0.54       0.05
##  [1] -263728.47       0.63       0.20       0.12       0.05       0.15
##  [7]       0.08       0.84       0.05       0.54       0.05
##  [1] -263710.86       0.62       0.20       0.12       0.06       0.15
##  [7]       0.08       0.84       0.05       0.54       0.05
##  [1] -263690.79       0.62       0.20       0.12       0.06       0.15
##  [7]       0.08       0.84       0.05       0.54       0.05
##  [1] -263668.41       0.62       0.20       0.13       0.06       0.15
##  [7]       0.08       0.84       0.05       0.54       0.05
##  [1] -263643.98       0.61       0.20       0.13       0.06       0.15
##  [7]       0.08       0.84       0.05       0.54       0.05
##  [1] -263617.89       0.61       0.20       0.13       0.06       0.15
##  [7]       0.08       0.84       0.05       0.54       0.05
##  [1] -263590.56       0.61       0.20       0.13       0.07       0.15
##  [7]       0.08       0.84       0.05       0.53       0.05
##  [1] -263562.23       0.61       0.20       0.13       0.07       0.15
##  [7]       0.08       0.84       0.05       0.53       0.05
##  [1] -263533.44       0.60       0.20       0.13       0.07       0.15
##  [7]       0.08       0.84       0.05       0.53       0.05
##  [1] -263504.42       0.60       0.20       0.13       0.07       0.15
##  [7]       0.08       0.84       0.05       0.53       0.06
##  [1] -263475.53       0.60       0.20       0.13       0.08       0.15
##  [7]       0.08       0.84       0.05       0.53       0.06
##  [1] -263447.02       0.59       0.20       0.13       0.08       0.14
##  [7]       0.08       0.84       0.05       0.53       0.06
##  [1] -263419.08       0.59       0.20       0.13       0.08       0.14
##  [7]       0.08       0.84       0.05       0.53       0.06
##  [1] -263391.89       0.59       0.20       0.13       0.08       0.14
##  [7]       0.08       0.84       0.05       0.53       0.06
##  [1] -263365.59       0.58       0.20       0.13       0.08       0.14
##  [7]       0.07       0.84       0.05       0.53       0.06
##  [1] -263340.26       0.58       0.20       0.13       0.09       0.14
##  [7]       0.07       0.84       0.05       0.52       0.06
##  [1] -263315.98       0.58       0.20       0.13       0.09       0.14
##  [7]       0.07       0.84       0.05       0.52       0.06
##  [1] -263292.80       0.57       0.20       0.13       0.09       0.14
##  [7]       0.07       0.84       0.05       0.52       0.06
##  [1] -263270.74       0.57       0.20       0.14       0.09       0.14
##  [7]       0.07       0.84       0.05       0.52       0.07
##  [1] -263249.81       0.57       0.20       0.14       0.10       0.14
##  [7]       0.07       0.84       0.05       0.52       0.07
##  [1] -263230.01       0.56       0.20       0.14       0.10       0.14
##  [7]       0.07       0.84       0.05       0.52       0.07
##  [1] -263211.31       0.56       0.20       0.14       0.10       0.14
##  [7]       0.07       0.84       0.05       0.52       0.07
##  [1] -263193.70       0.55       0.20       0.14       0.10       0.14
##  [7]       0.07       0.84       0.05       0.52       0.07
##  [1] -263177.14       0.55       0.20       0.14       0.11       0.14
##  [7]       0.07       0.84       0.05       0.51       0.07
##  [1] -263161.61       0.55       0.20       0.14       0.11       0.14
##  [7]       0.07       0.84       0.05       0.51       0.07
##  [1] -263147.06       0.54       0.20       0.14       0.11       0.14
##  [7]       0.07       0.84       0.05       0.51       0.07
##  [1] -263133.46       0.54       0.20       0.14       0.12       0.14
##  [7]       0.07       0.84       0.05       0.51       0.07
##  [1] -263120.76       0.54       0.20       0.14       0.12       0.14
##  [7]       0.07       0.84       0.05       0.51       0.08
##  [1] -263108.94       0.53       0.20       0.14       0.12       0.14
##  [7]       0.07       0.84       0.05       0.51       0.08
##  [1] -263097.94       0.53       0.20       0.14       0.12       0.14
##  [7]       0.07       0.84       0.05       0.51       0.08
##  [1] -263087.74       0.52       0.21       0.15       0.13       0.13
##  [7]       0.07       0.84       0.05       0.51       0.08
##  [1] -263078.30       0.52       0.21       0.15       0.13       0.13
##  [7]       0.07       0.84       0.05       0.51       0.08
## [1] 30
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -265331.09       0.54       0.19       0.25       0.02       0.15
##  [7]       0.09       0.89       0.04       0.51       0.05
##  [1] -263250.28       0.59       0.16       0.23       0.02       0.16
##  [7]       0.10       0.88       0.04       0.52       0.04
##  [1] -262967.28       0.61       0.14       0.22       0.03       0.17
##  [7]       0.10       0.88       0.04       0.53       0.04
##  [1] -262859.40       0.62       0.13       0.22       0.04       0.17
##  [7]       0.10       0.88       0.04       0.54       0.04
##  [1] -262808.62       0.62       0.12       0.22       0.04       0.17
##  [7]       0.10       0.88       0.04       0.54       0.04
##  [1] -262779.47       0.62       0.11       0.22       0.04       0.17
##  [7]       0.10       0.88       0.04       0.55       0.04
##  [1] -262758.20       0.63       0.11       0.22       0.05       0.17
##  [7]       0.10       0.88       0.04       0.55       0.04
##  [1] -262739.49       0.62       0.11       0.22       0.05       0.17
##  [7]       0.10       0.88       0.04       0.55       0.04
##  [1] -262722.20       0.62       0.10       0.22       0.06       0.16
##  [7]       0.10       0.88       0.04       0.56       0.04
##  [1] -262705.72       0.62       0.10       0.22       0.06       0.16
##  [7]       0.10       0.88       0.04       0.56       0.04
##  [1] -262690.48       0.62       0.10       0.22       0.06       0.16
##  [7]       0.09       0.88       0.04       0.56       0.04
##  [1] -262676.98       0.62       0.10       0.22       0.07       0.16
##  [7]       0.09       0.88       0.04       0.56       0.04
##  [1] -262665.76       0.62       0.10       0.22       0.07       0.15
##  [7]       0.09       0.88       0.04       0.56       0.04
##  [1] -262657.20       0.61       0.10       0.22       0.07       0.15
##  [7]       0.08       0.88       0.04       0.57       0.04
plts_paired_order<-plts_paired[order(sampleinfo_organoid_notfetal$passage.or.rescope.no_numeric)]

pdf(here("figs","MTAB4957_organoids_thresholding_all_samples.pdf"))
plts_paired_order
## [[1]]
## 
## [[2]]
## 
## [[3]]
## 
## [[4]]
## 
## [[5]]
## 
## [[6]]
## 
## [[7]]
## 
## [[8]]
## 
## [[9]]
## 
## [[10]]
## 
## [[11]]
## 
## [[12]]
## 
## [[13]]
## 
## [[14]]
## 
## [[15]]
## 
## [[16]]
## 
## [[17]]
## 
## [[18]]
## 
## [[19]]
## 
## [[20]]
## 
## [[21]]
## 
## [[22]]
## 
## [[23]]
## 
## [[24]]
## 
## [[25]]
## 
## [[26]]
## 
## [[27]]
## Warning: Removed 2 rows containing missing values (geom_bar).
## 
## [[28]]
## Warning: Removed 2 rows containing missing values (geom_bar).
## 
## [[29]]
## 
## [[30]]
dev.off()
## png 
##   2

Fetal Organoids

sampleinfo_organoid_fetal<-sampleinfo_organoid[which(sampleinfo_organoid$Characteristics.biosource.type.=="organoid" & sampleinfo_organoid$Characteristics.developmental.stage.=="fetal stage"),]
sampleinfo_organoid_fetal<-sampleinfo_organoid_fetal[-grep("KO", sampleinfo_organoid_fetal$condition),]
MTAB_organoid_beta_fetal<-MTAB_organoid_beta[,which(colnames(MTAB_organoid_beta)%in%sampleinfo_organoid_fetal$Assay.Name)]
identical(colnames(MTAB_organoid_beta_fetal),sampleinfo_organoid_fetal$Assay.Name)
## [1] TRUE
# ' ### PCA organoids
pca_res <- prcomp(t(MTAB_organoid_beta_fetal))
Loadings<-as.data.frame(pca_res$x)
vars <- pca_res$sdev^2
Importance<-vars/sum(vars)

meta_categorical <- sampleinfo_organoid_fetal[, c(4,8,13,17,18)]  # input column numbers in meta that contain categorical variables
meta_continuous <- sampleinfo_organoid_fetal[, c(9,21)]  # input column numbers in meta that contain continuous variables
colnames(meta_categorical) <- c("Individual", "Sample Site","Sex","Block","Sentrix ID")
colnames(meta_continuous) <- c("Age", "Passage")
meta_continuous$Age<-as.numeric(meta_continuous$Age)
meta_categorical$Block<-as.factor(meta_categorical$Block)

ord<-1:length(c(colnames(meta_categorical),colnames(meta_continuous)))
PCs_to_view<-10
suppressWarnings(heat_scree_plot(Loadings, Importance, 2.5, 2.7))

## PC vs PC plot
Loadings$Assay.Name<-rownames(Loadings)
Loadings_meta<-merge(Loadings, sampleinfo_organoid_fetal, by="Assay.Name")

Sample Site

ggplot(Loadings_meta, aes(PC1, PC2, fill=Characteristics.sampling.site.))+geom_point(shape=21,size=3, color="black")+theme_bw()+
  xlab(paste("PC1 (",round(Importance[1]*100,0),"%)", sep=""))+ylab(paste("PC2 (",round(Importance[2]*100,0),"%)", sep=""))+th+theme(axis.text = element_text(size=12),
                                               axis.title = element_text(size=14),
                                               plot.margin = margin(1, 0.1, 1, 1, "cm"))

pc_plt<-ggplot(Loadings_meta, aes(PC1, PC2, fill=as.factor(passage.or.rescope.no_numeric)))+geom_line(aes(PC1,PC2, group=sample_ID), color="lightgrey")+#, color=sampling.time.point
  geom_point(shape=21,size=3)+#
  theme_bw()+xlab(paste("PC1 (",round(Importance[1]*100,0),"%)", sep=""))+ylab(paste("PC2 (",round(Importance[2]*100,0),"%)", sep=""))+th+theme(axis.text = element_text(size=12),axis.title = element_text(size=14))+
  scale_fill_manual(values=c(colorRampPalette(brewer.pal(11, "Spectral"))(11), "#544791","#4a3e80", "#40366f","#221d3c"),name="Passage\nNumber")+scale_color_manual(values=c("black","white","black"))

legend<-ggplot(sampleinfo_organoid_fetal, aes(as.factor(-passage.or.rescope.no_numeric), fill=as.factor(passage.or.rescope.no_numeric)))+geom_bar(color="black")+
  theme_bw()+theme(legend.position = "none", axis.text.y = element_blank(),
                   axis.title.y = element_blank(),
                   axis.ticks.y = element_blank(),
                   legend.title=element_text(size=10),
                   legend.text=element_text(size=8))+
  coord_flip()+
  scale_fill_manual(values=c(colorRampPalette(brewer.pal(11, "Spectral"))(11), "#544791","#4a3e80", "#40366f","#221d3c"),name="Passage\nNumber")+th

r <- ggplot() + theme_void()

grid.arrange(pc_plt,arrangeGrob(r,legend,r, heights=c(0.6,1.25,0.4)), ncol=2, widths=c(7,1))

Variable Beta Distribution (fetal)

Variation<-function(x) {quantile(x, c(0.9), na.rm=T)[[1]]-quantile(x, c(0.1), na.rm=T)[[1]]}
Mval<-function(beta) log2(beta/(1-beta))

MTAB4957_mval= apply(MTAB_organoid_beta_fetal, 1, Mval) # need mvalues for combat
MTAB4957_mval = as.data.frame(MTAB4957_mval)
MTAB4957_mval = t(MTAB4957_mval)


ref_range_dnam<-sapply(1:nrow(MTAB4957_mval), function(x) Variation(MTAB4957_mval[x,]))
dim(MTAB4957_beta_VeryVariable<-MTAB_organoid_beta_fetal[which(ref_range_dnam>=2.75),])#  28418
## [1] 28418    26
## Beta distribution plot
Beta_melted<- melt(MTAB4957_beta_VeryVariable)
Beta_Plot<-Beta_melted[which(!(is.na(Beta_melted$value))),]
colnames(Beta_Plot)<-c("CpG","ID","Beta")
Beta_Plot<-merge(Beta_Plot,sampleinfo_organoid_fetal, by.x="ID", by.y="Assay.Name")

Beta_Plot$passage.or.rescope.no_numeric.factor <- factor(Beta_Plot$passage.or.rescope.no_numeric, levels = c(23,21,14,12,9,7,6,5,3,2,1))

ggplot(Beta_Plot, aes(Beta,color=passage.or.rescope.no_numeric.factor))+
  geom_density(size=1)+theme_bw()+xlab("DNAm Beta Value")+ylab("Density")+
  scale_color_manual(values=pass_col, name="Passage\nNumber")+th+theme(legend.text = element_text(size=7),
                                                                       legend.title = element_text(size=10),
                                                                       legend.key.size = unit(0.7,"line"))

To view the beta distributions we will also include a line for the 11 primary fetal samples to compare each passage to primary

identical(colnames(organoid_fetal_primary),sampleinfo_fetal_primary$Assay.Name)
## [1] TRUE
MTAB4957_mval= apply(organoid_fetal_primary, 1, Mval) # need mvalues for combat
MTAB4957_mval = as.data.frame(MTAB4957_mval)
MTAB4957_mval = t(MTAB4957_mval)

ref_range_dnam_fetal<-sapply(1:nrow(MTAB4957_mval), function(x) Variation(MTAB4957_mval[x,]))
dim(organoid_fetal_primary_VeryVariable<-organoid_fetal_primary[rev(order(ref_range_dnam_fetal)),])
## [1] 409528     11
dim(organoid_fetal_primary_VeryVariable<-organoid_fetal_primary_VeryVariable[1:28418 ,])# same number as MTAB organoid varible
## [1] 28418    11
Beta_melted_MTAB_primary<- melt(organoid_fetal_primary_VeryVariable)
Beta_Plot_MTAB_primary<-Beta_melted_MTAB_primary[which(!(is.na(Beta_melted_MTAB_primary$value))),]
colnames(Beta_Plot_MTAB_primary)<-c("CpG","ID","Beta")
Beta_Plot_MTAB_primary<-merge(Beta_Plot_MTAB_primary,sampleinfo_fetal_primary, by.x="ID", by.y="Assay.Name")
Beta_plot_primary<-Beta_Plot_MTAB_primary[,c(1:3)]
Beta_plot_primary$passage.or.rescope.no_numeric<-0
Beta_Plot<-Beta_Plot[,c(1:3,23)]

Beta_Plot_combined<-rbind(Beta_plot_primary,Beta_Plot)

Beta_Plot_combined$passage.or.rescope.no_numeric.factor <- factor(Beta_Plot_combined$passage.or.rescope.no_numeric, levels = c(23,21,14,12,9,7,6,5,3,2,1,0))

ggplot(Beta_Plot_combined, aes(Beta,color=as.factor(passage.or.rescope.no_numeric.factor)))+
  geom_density(size=1)+theme_bw()+xlab("DNAm Beta Value")+ylab("Density")+
  scale_color_manual(values=pass_col, name="Passage\nNumber")+th+theme(legend.text = element_text(size=7),
                                                                       legend.title = element_text(size=10),
                                                                       legend.key.size = unit(0.7,"line"))

ggsave(here("figs","MTAB4957_beta_fetal_with_primary.pdf"),width = 3.75, height = 2.5)
ggsave(here("figs/jpeg","MTAB4957_beta_fetal_with_primary.jpeg"), w=5, h=3)

Paired Samples in beta plots

sampleinfo_organoid_fetal$sample_ID<-paste(sampleinfo_organoid_fetal$Characteristics.individual., sampleinfo_organoid_fetal$Characteristics.sampling.site.)
sampleinfo_organoid_paired<-sampleinfo_organoid_fetal[which(sampleinfo_organoid_fetal$sample_ID%in%sampleinfo_organoid_fetal$sample_ID[duplicated(sampleinfo_organoid_fetal$sample_ID)]),]

MTAB4957.organoid_paired<-do.call(rbind,lapply(1:length(unique(sampleinfo_organoid_paired$sample_ID)), function(x){
  sample<-unique(sampleinfo_organoid_paired$sample_ID)[x]
  samp<-sampleinfo_organoid_paired[sampleinfo_organoid_paired$sample_ID==sample,]
  samp<-samp[order(samp$passage.or.rescope.no_numeric),]
  samp$hilo<-as.factor(samp$passage.or.rescope.no_numeric)

  if(length(levels(samp$hilo))==2){levels(samp$hilo)<-c("lower","higher")}else{
    if(length(levels(samp$hilo))==3){levels(samp$hilo)<-c("lower","higher","highest")}else{
      if(length(levels(samp$hilo))==4){levels(samp$hilo)<-c("lowest","lower","higher","highest")}else{samp$hilo<-NA}
    }
  }
  samp
}))

MTAB4957.organoid_paired<-MTAB4957.organoid_paired[which(!is.na(MTAB4957.organoid_paired$hilo)),]
MTAB4957.organoid_paired$hilo<-factor(MTAB4957.organoid_paired$hilo, c("lowest","lower","higher","highest"))

identical(colnames(MTAB4957_beta_VeryVariable), sampleinfo_organoid_fetal$Assay.Name)
## [1] TRUE
MTAB4957_beta_VeryVariable_paird<-MTAB4957_beta_VeryVariable[,which(sampleinfo_organoid_fetal$sample_ID%in%MTAB4957.organoid_paired$sample_ID)]



Beta_melted<- melt(MTAB4957_beta_VeryVariable_paird)
Beta_Plot<-Beta_melted[which(!(is.na(Beta_melted$value))),]
colnames(Beta_Plot)<-c("CpG","ID","Beta")
Beta_Plot<-merge(Beta_Plot,MTAB4957.organoid_paired, by.x="ID", by.y="Assay.Name")


labels<-as.data.frame(tapply(MTAB4957.organoid_paired$passage.or.rescope.no_numeric, MTAB4957.organoid_paired$sample_ID, function(x) paste(x, collapse=", ")))
colnames(labels)<-"passge"
labels$sample_ID<-rownames(labels)

ggplot()+
  geom_density(aes(Beta,color=hilo, group=ID),Beta_Plot, size=0.75)+theme_bw()+xlab("DNAm Beta Value")+ylab("Density")+
  scale_color_manual(values = c ("#9ecae1","#4292c6", "#225ea8", "#081d58"), name="Relative\nPassage\nLevel within\nPatient")+facet_wrap(~sample_ID, nrow=2)+
  geom_text(aes(0.5, 2.75, label=passge), data=labels, color="grey20")+th+theme(strip.text = element_text(size = 10),
                                                                                 axis.text=element_text(size=4),
                                                                                 panel.spacing = unit(0.7, "lines"))+
  scale_x_continuous(breaks = c(0,0.5,1))

ggsave(here("figs","MTAB4957_beta_paired_fetal.pdf"),w=6, height = 3.75)
ggsave(here("figs/jpeg","MTAB4957_beta_paired_fetal.jpeg"), w=6, height = 3.75)

Thresholding trimodal samples

sampleinfo_organoid_fetal$thresholded_prior_ratio<-sapply(1:nrow(sampleinfo_organoid_fetal), function(x){
  print(x)
  converted<-as.numeric(round(MTAB4957_beta_VeryVariable[,x]*1000,0))
  counts<-rep(1000, length(converted))
  res = em(converted, counts, .41, .31, .27, 0.01, .1, .1, .90, .03, .5, .05)
  passage_threshold_params(converted, counts, res)
})
## [1] 1
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -157952.80       0.56       0.28       0.14       0.02       0.14
##  [7]       0.09       0.89       0.04       0.50       0.04
##  [1] -156698.25       0.60       0.27       0.11       0.03       0.15
##  [7]       0.09       0.88       0.04       0.50       0.04
##  [1] -156685.93       0.62       0.26       0.09       0.04       0.15
##  [7]       0.09       0.88       0.05       0.50       0.03
##  [1] -156733.66       0.63       0.25       0.08       0.05       0.15
##  [7]       0.09       0.88       0.05       0.50       0.03
##  [1] -156784.92       0.63       0.24       0.07       0.05       0.15
##  [7]       0.09       0.88       0.05       0.50       0.03
##  [1] -156828.44       0.63       0.24       0.07       0.06       0.15
##  [7]       0.09       0.88       0.05       0.50       0.03
##  [1] -156863.15       0.63       0.24       0.06       0.07       0.15
##  [7]       0.09       0.88       0.04       0.50       0.03
##  [1] -156890.89       0.63       0.23       0.06       0.07       0.14
##  [7]       0.08       0.88       0.04       0.50       0.03
##  [1] -156912.20       0.63       0.23       0.06       0.08       0.14
##  [7]       0.08       0.88       0.04       0.50       0.03
##  [1] -156929.66       0.63       0.23       0.06       0.08       0.14
##  [7]       0.08       0.89       0.04       0.50       0.03
##  [1] -156944.50       0.63       0.23       0.06       0.09       0.14
##  [7]       0.08       0.89       0.04       0.50       0.03
##  [1] -156957.82       0.62       0.23       0.06       0.09       0.13
##  [7]       0.07       0.89       0.04       0.50       0.03
##  [1] -156970.26       0.62       0.22       0.06       0.09       0.13
##  [7]       0.07       0.89       0.03       0.50       0.04
##  [1] -156982.27       0.62       0.22       0.06       0.10       0.13
##  [7]       0.07       0.89       0.03       0.50       0.04
##  [1] -156994.24       0.62       0.22       0.06       0.10       0.13
##  [7]       0.07       0.89       0.03       0.50       0.04
##  [1] -157006.40       0.62       0.22       0.06       0.11       0.12
##  [7]       0.07       0.90       0.03       0.49       0.04
##  [1] -157018.95       0.62       0.22       0.06       0.11       0.12
##  [7]       0.06       0.90       0.03       0.49       0.04
##  [1] -157032.07       0.62       0.22       0.06       0.11       0.12
##  [7]       0.06       0.90       0.03       0.49       0.04
##  [1] -157046.11       0.61       0.21       0.06       0.12       0.12
##  [7]       0.06       0.90       0.03       0.49       0.05
##  [1] -157060.79       0.61       0.21       0.06       0.12       0.12
##  [7]       0.06       0.90       0.03       0.49       0.05
##  [1] -157076.20       0.61       0.21       0.06       0.12       0.11
##  [7]       0.06       0.90       0.03       0.49       0.05
##  [1] -157092.33       0.61       0.21       0.06       0.13       0.11
##  [7]       0.05       0.90       0.02       0.48       0.05
##  [1] -157109.19       0.61       0.21       0.06       0.13       0.11
##  [7]       0.05       0.91       0.02       0.48       0.05
##  [1] -157127.55       0.61       0.21       0.06       0.13       0.11
##  [7]       0.05       0.91       0.02       0.48       0.06
##  [1] -157146.52       0.61       0.20       0.06       0.13       0.11
##  [7]       0.05       0.91       0.02       0.48       0.06
##  [1] -157166.10       0.61       0.20       0.05       0.14       0.11
##  [7]       0.05       0.91       0.02       0.48       0.06
##  [1] -157186.25       0.60       0.20       0.05       0.14       0.10
##  [7]       0.05       0.91       0.02       0.47       0.06
##  [1] -157206.95       0.60       0.20       0.05       0.14       0.10
##  [7]       0.04       0.91       0.02       0.47       0.06
##  [1] -157228.14       0.60       0.20       0.05       0.15       0.10
##  [7]       0.04       0.91       0.02       0.47       0.07
##  [1] -157249.76       0.60       0.19       0.05       0.15       0.10
##  [7]       0.04       0.91       0.02       0.47       0.07
##  [1] -157271.76       0.60       0.19       0.05       0.15       0.10
##  [7]       0.04       0.91       0.02       0.47       0.07
##  [1] -157294.09       0.60       0.19       0.05       0.16       0.10
##  [7]       0.04       0.91       0.02       0.46       0.07
##  [1] -157316.67       0.60       0.19       0.05       0.16       0.09
##  [7]       0.04       0.91       0.02       0.46       0.08
##  [1] -157339.47       0.60       0.19       0.05       0.16       0.09
##  [7]       0.04       0.91       0.02       0.46       0.08
##  [1] -157362.41       0.59       0.19       0.05       0.17       0.09
##  [7]       0.03       0.91       0.02       0.46       0.08
##  [1] -157383.97       0.59       0.18       0.05       0.17       0.09
##  [7]       0.03       0.91       0.02       0.46       0.08
##  [1] -157405.81       0.59       0.18       0.05       0.17       0.09
##  [7]       0.03       0.91       0.02       0.46       0.08
##  [1] -157427.80       0.59       0.18       0.05       0.17       0.09
##  [7]       0.03       0.91       0.02       0.45       0.09
##  [1] -157449.85       0.59       0.18       0.05       0.18       0.09
##  [7]       0.03       0.92       0.02       0.45       0.09
##  [1] -157471.88       0.59       0.18       0.05       0.18       0.09
##  [7]       0.03       0.92       0.02       0.45       0.09
##  [1] -157493.85       0.59       0.18       0.05       0.18       0.09
##  [7]       0.03       0.92       0.02       0.45       0.09
##  [1] -157515.72       0.58       0.18       0.05       0.19       0.08
##  [7]       0.03       0.92       0.02       0.45       0.10
##  [1] -157537.45       0.58       0.18       0.05       0.19       0.08
##  [7]       0.03       0.92       0.02       0.45       0.10
##  [1] -157559.01       0.58       0.17       0.05       0.19       0.08
##  [7]       0.03       0.92       0.02       0.45       0.10
##  [1] -157580.39       0.58       0.17       0.05       0.19       0.08
##  [7]       0.03       0.92       0.02       0.44       0.10
##  [1] -157601.56       0.58       0.17       0.05       0.20       0.08
##  [7]       0.03       0.92       0.02       0.44       0.10
##  [1] -157622.51       0.58       0.17       0.05       0.20       0.08
##  [7]       0.03       0.92       0.02       0.44       0.11
##  [1] -157643.23       0.57       0.17       0.05       0.20       0.08
##  [7]       0.03       0.92       0.02       0.44       0.11
##  [1] -157663.67       0.57       0.17       0.05       0.21       0.08
##  [7]       0.02       0.92       0.02       0.44       0.11
##  [1] -157683.93       0.57       0.17       0.05       0.21       0.08
##  [7]       0.02       0.92       0.02       0.44       0.11
##  [1] -157703.91       0.57       0.17       0.05       0.21       0.08
##  [7]       0.02       0.92       0.02       0.44       0.12
##  [1] -157723.64       0.57       0.17       0.05       0.22       0.08
##  [7]       0.02       0.92       0.02       0.44       0.12
##  [1] -157743.11       0.56       0.16       0.05       0.22       0.08
##  [7]       0.02       0.92       0.02       0.44       0.12
##  [1] -157762.32       0.56       0.16       0.05       0.22       0.08
##  [7]       0.02       0.92       0.02       0.43       0.12
##  [1] -157781.27       0.56       0.16       0.05       0.22       0.08
##  [7]       0.02       0.92       0.02       0.43       0.12
##  [1] -157799.96       0.56       0.16       0.06       0.23       0.08
##  [7]       0.02       0.92       0.02       0.43       0.13
##  [1] -157818.40       0.55       0.16       0.06       0.23       0.07
##  [7]       0.02       0.92       0.02       0.43       0.13
##  [1] -157834.71       0.55       0.16       0.06       0.23       0.07
##  [7]       0.02       0.92       0.02       0.43       0.13
##  [1] -157851.11       0.55       0.16       0.06       0.24       0.07
##  [7]       0.02       0.92       0.02       0.43       0.13
##  [1] -157867.58       0.55       0.16       0.06       0.24       0.07
##  [7]       0.02       0.92       0.02       0.43       0.13
##  [1] -157884.01       0.54       0.16       0.06       0.24       0.07
##  [7]       0.02       0.92       0.02       0.43       0.14
##  [1] -157901.25       0.54       0.16       0.06       0.25       0.07
##  [7]       0.02       0.92       0.02       0.43       0.14
##  [1] -157917.48       0.54       0.16       0.06       0.25       0.07
##  [7]       0.02       0.92       0.02       0.43       0.14
##  [1] -157934.18       0.53       0.16       0.06       0.25       0.07
##  [7]       0.02       0.92       0.02       0.43       0.14
##  [1] -157950.71       0.53       0.16       0.06       0.26       0.07
##  [7]       0.02       0.92       0.02       0.43       0.14
##  [1] -157966.87       0.53       0.15       0.06       0.26       0.07
##  [7]       0.02       0.92       0.02       0.43       0.15
##  [1] -157982.65       0.53       0.15       0.06       0.26       0.07
##  [7]       0.02       0.92       0.02       0.43       0.15
##  [1] -157998.21       0.52       0.15       0.06       0.27       0.07
##  [7]       0.02       0.92       0.02       0.43       0.15
##  [1] -158013.41       0.52       0.15       0.06       0.27       0.07
##  [7]       0.02       0.92       0.02       0.43       0.15
##  [1] -158028.30       0.52       0.15       0.06       0.27       0.07
##  [7]       0.02       0.92       0.02       0.43       0.15
##  [1] -158042.86       0.51       0.15       0.06       0.28       0.07
##  [7]       0.02       0.92       0.02       0.43       0.15
##  [1] -158057.09       0.51       0.15       0.06       0.28       0.07
##  [7]       0.02       0.92       0.02       0.43       0.16
##  [1] -158070.99       0.51       0.15       0.06       0.28       0.07
##  [7]       0.02       0.92       0.02       0.43       0.16
##  [1] -158084.55       0.50       0.15       0.06       0.29       0.07
##  [7]       0.02       0.92       0.02       0.43       0.16
##  [1] -158097.78       0.50       0.15       0.06       0.29       0.07
##  [7]       0.02       0.92       0.02       0.43       0.16
##  [1] -158110.65       0.50       0.15       0.06       0.29       0.07
##  [7]       0.02       0.92       0.02       0.43       0.16
##  [1] -158123.16       0.49       0.15       0.06       0.30       0.07
##  [7]       0.02       0.92       0.02       0.43       0.16
##  [1] -158135.34       0.49       0.15       0.06       0.30       0.07
##  [7]       0.02       0.92       0.02       0.43       0.16
##  [1] -158147.16       0.49       0.15       0.06       0.30       0.07
##  [7]       0.02       0.92       0.02       0.43       0.17
##  [1] -158158.39       0.48       0.15       0.06       0.31       0.07
##  [7]       0.02       0.92       0.02       0.43       0.17
##  [1] -158169.94       0.48       0.15       0.06       0.31       0.07
##  [7]       0.02       0.92       0.02       0.43       0.17
##  [1] -158180.40       0.48       0.15       0.06       0.32       0.07
##  [7]       0.02       0.92       0.02       0.43       0.17
##  [1] -158191.34       0.47       0.15       0.06       0.32       0.07
##  [7]       0.02       0.92       0.02       0.43       0.17
##  [1] -158200.68       0.47       0.15       0.06       0.32       0.07
##  [7]       0.02       0.92       0.02       0.43       0.17
## [1] 2
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -159957.90       0.58       0.16       0.24       0.02       0.17
##  [7]       0.10       0.87       0.03       0.52       0.05
##  [1] -156264.73       0.62       0.12       0.24       0.03       0.19
##  [7]       0.11       0.85       0.03       0.54       0.05
##  [1] -155514.48       0.62       0.10       0.25       0.03       0.21
##  [7]       0.11       0.84       0.03       0.55       0.04
##  [1] -155286.99       0.62       0.09       0.25       0.04       0.23
##  [7]       0.12       0.83       0.03       0.56       0.04
##  [1] -155230.55       0.62       0.08       0.26       0.04       0.24
##  [7]       0.12       0.83       0.03       0.56       0.04
##  [1] -155236.15       0.61       0.08       0.26       0.05       0.25
##  [7]       0.13       0.83       0.04       0.57       0.04
## [1] 3
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -156851.65       0.52       0.33       0.14       0.02       0.13
##  [7]       0.08       0.90       0.04       0.49       0.04
##  [1] -155670.41       0.54       0.33       0.11       0.02       0.13
##  [7]       0.08       0.90       0.04       0.49       0.04
##  [1] -155746.33       0.56       0.32       0.09       0.03       0.13
##  [7]       0.08       0.90       0.04       0.49       0.04
##  [1] -155871.81       0.56       0.32       0.08       0.03       0.13
##  [7]       0.08       0.91       0.04       0.48       0.03
##  [1] -155999.20       0.57       0.31       0.08       0.04       0.13
##  [7]       0.08       0.91       0.04       0.48       0.03
##  [1] -156117.45       0.57       0.31       0.08       0.05       0.13
##  [7]       0.07       0.91       0.03       0.48       0.03
##  [1] -156221.30       0.57       0.31       0.07       0.05       0.13
##  [7]       0.07       0.92       0.03       0.47       0.03
##  [1] -156307.54       0.57       0.30       0.07       0.06       0.13
##  [7]       0.07       0.92       0.03       0.47       0.03
##  [1] -156375.50       0.57       0.30       0.07       0.06       0.12
##  [7]       0.07       0.92       0.03       0.47       0.03
##  [1] -156424.53       0.57       0.30       0.07       0.06       0.12
##  [7]       0.07       0.92       0.02       0.47       0.03
##  [1] -156456.09       0.57       0.30       0.07       0.07       0.12
##  [7]       0.06       0.93       0.02       0.46       0.03
##  [1] -156472.42       0.56       0.30       0.07       0.07       0.12
##  [7]       0.06       0.93       0.02       0.46       0.03
##  [1] -156474.93       0.56       0.29       0.07       0.08       0.12
##  [7]       0.06       0.93       0.02       0.46       0.03
## [1] 4
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -155944.91       0.46       0.43       0.10       0.01       0.12
##  [7]       0.06       0.89       0.04       0.48       0.05
##  [1] -153982.54       0.45       0.47       0.07       0.01       0.12
##  [7]       0.06       0.90       0.04       0.47       0.04
##  [1] -153857.92       0.44       0.48       0.06       0.02       0.12
##  [7]       0.06       0.90       0.04       0.46       0.04
##  [1] -153888.03       0.44       0.49       0.05       0.02       0.12
##  [7]       0.06       0.90       0.04       0.45       0.04
##  [1] -153959.91       0.44       0.49       0.05       0.02       0.12
##  [7]       0.06       0.91       0.03       0.45       0.04
##  [1] -154040.24       0.44       0.49       0.04       0.03       0.12
##  [7]       0.06       0.91       0.03       0.44       0.03
##  [1] -154113.45       0.44       0.48       0.04       0.03       0.12
##  [7]       0.06       0.91       0.03       0.43       0.03
##  [1] -154171.74       0.44       0.48       0.04       0.03       0.12
##  [7]       0.06       0.91       0.03       0.43       0.03
##  [1] -154211.24       0.44       0.48       0.04       0.04       0.11
##  [7]       0.06       0.92       0.02       0.42       0.03
##  [1] -154230.92       0.44       0.48       0.04       0.04       0.11
##  [7]       0.05       0.92       0.02       0.42       0.03
##  [1] -154231.47       0.43       0.48       0.04       0.05       0.11
##  [7]       0.05       0.92       0.02       0.42       0.03
## [1] 5
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -156833.58       0.51       0.39       0.09       0.02       0.12
##  [7]       0.07       0.88       0.04       0.49       0.04
##  [1] -155288.23       0.51       0.41       0.05       0.02       0.12
##  [7]       0.07       0.88       0.04       0.48       0.04
##  [1] -155206.60       0.52       0.42       0.04       0.03       0.12
##  [7]       0.07       0.88       0.04       0.47       0.03
##  [1] -155226.02       0.52       0.42       0.03       0.04       0.12
##  [7]       0.07       0.88       0.04       0.46       0.03
##  [1] -155267.09       0.52       0.41       0.02       0.04       0.12
##  [7]       0.07       0.88       0.04       0.46       0.03
##  [1] -155306.10       0.51       0.41       0.02       0.05       0.12
##  [7]       0.07       0.88       0.04       0.45       0.03
##  [1] -155334.58       0.51       0.41       0.02       0.06       0.12
##  [7]       0.07       0.88       0.04       0.45       0.03
##  [1] -155350.38       0.50       0.41       0.02       0.07       0.12
##  [7]       0.06       0.88       0.04       0.45       0.03
##  [1] -155354.20       0.50       0.41       0.02       0.08       0.12
##  [7]       0.06       0.89       0.03       0.44       0.03
## [1] 6
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -157509.21       0.54       0.25       0.19       0.02       0.13
##  [7]       0.09       0.88       0.04       0.51       0.04
##  [1] -156289.32       0.59       0.22       0.17       0.03       0.13
##  [7]       0.09       0.87       0.04       0.52       0.04
##  [1] -156129.04       0.61       0.20       0.15       0.03       0.13
##  [7]       0.08       0.87       0.05       0.53       0.04
##  [1] -156091.06       0.62       0.19       0.15       0.04       0.13
##  [7]       0.08       0.86       0.05       0.53       0.03
##  [1] -156095.91       0.62       0.19       0.15       0.04       0.12
##  [7]       0.08       0.86       0.05       0.53       0.03
## [1] 7
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -158735.16       0.57       0.29       0.11       0.02       0.13
##  [7]       0.09       0.87       0.04       0.50       0.04
##  [1] -157153.62       0.62       0.28       0.08       0.03       0.14
##  [7]       0.09       0.86       0.05       0.51       0.04
##  [1] -156846.37       0.63       0.27       0.06       0.04       0.15
##  [7]       0.09       0.84       0.06       0.51       0.04
##  [1] -156673.36       0.64       0.26       0.05       0.05       0.15
##  [7]       0.10       0.83       0.06       0.51       0.04
##  [1] -156555.97       0.64       0.25       0.05       0.06       0.15
##  [7]       0.09       0.81       0.07       0.51       0.04
##  [1] -156470.97       0.64       0.25       0.04       0.06       0.14
##  [7]       0.09       0.80       0.07       0.51       0.03
##  [1] -156406.80       0.64       0.25       0.04       0.07       0.14
##  [7]       0.09       0.79       0.07       0.51       0.04
##  [1] -156355.33       0.64       0.25       0.04       0.08       0.14
##  [7]       0.09       0.78       0.07       0.51       0.04
##  [1] -156311.68       0.63       0.25       0.04       0.08       0.14
##  [7]       0.09       0.78       0.07       0.51       0.04
##  [1] -156272.32       0.63       0.24       0.04       0.09       0.14
##  [7]       0.08       0.77       0.08       0.51       0.04
##  [1] -156234.85       0.63       0.24       0.04       0.09       0.13
##  [7]       0.08       0.76       0.08       0.51       0.04
##  [1] -156197.68       0.62       0.24       0.04       0.10       0.13
##  [7]       0.08       0.76       0.08       0.50       0.04
##  [1] -156159.84       0.62       0.24       0.04       0.10       0.13
##  [7]       0.08       0.76       0.08       0.50       0.04
##  [1] -156120.89       0.62       0.24       0.04       0.10       0.13
##  [7]       0.07       0.75       0.08       0.50       0.04
##  [1] -156080.77       0.61       0.24       0.04       0.11       0.12
##  [7]       0.07       0.75       0.08       0.50       0.04
##  [1] -156039.62       0.61       0.24       0.04       0.11       0.12
##  [7]       0.07       0.75       0.08       0.50       0.05
##  [1] -155997.75       0.61       0.23       0.04       0.12       0.12
##  [7]       0.07       0.74       0.08       0.49       0.05
##  [1] -155955.50       0.61       0.23       0.04       0.12       0.12
##  [7]       0.07       0.74       0.08       0.49       0.05
##  [1] -155913.25       0.60       0.23       0.04       0.12       0.11
##  [7]       0.06       0.74       0.08       0.49       0.05
##  [1] -155871.36       0.60       0.23       0.04       0.13       0.11
##  [7]       0.06       0.74       0.08       0.48       0.05
##  [1] -155830.18       0.60       0.23       0.04       0.13       0.11
##  [7]       0.06       0.74       0.08       0.48       0.06
##  [1] -155790.02       0.60       0.22       0.05       0.13       0.11
##  [7]       0.06       0.74       0.08       0.48       0.06
##  [1] -155751.15       0.60       0.22       0.05       0.14       0.11
##  [7]       0.05       0.74       0.08       0.47       0.06
##  [1] -155713.78       0.59       0.22       0.05       0.14       0.10
##  [7]       0.05       0.74       0.08       0.47       0.06
##  [1] -155678.12       0.59       0.22       0.05       0.14       0.10
##  [7]       0.05       0.73       0.08       0.47       0.06
##  [1] -155644.30       0.59       0.22       0.05       0.15       0.10
##  [7]       0.05       0.73       0.08       0.47       0.06
##  [1] -155612.46       0.59       0.21       0.05       0.15       0.10
##  [7]       0.05       0.73       0.08       0.46       0.07
##  [1] -155582.68       0.58       0.21       0.05       0.15       0.10
##  [7]       0.05       0.73       0.08       0.46       0.07
##  [1] -155555.02       0.58       0.21       0.05       0.16       0.09
##  [7]       0.04       0.73       0.08       0.46       0.07
##  [1] -155529.53       0.58       0.21       0.05       0.16       0.09
##  [7]       0.04       0.73       0.08       0.45       0.07
##  [1] -155506.18       0.58       0.21       0.05       0.16       0.09
##  [7]       0.04       0.73       0.08       0.45       0.07
##  [1] -155484.98       0.58       0.20       0.05       0.17       0.09
##  [7]       0.04       0.73       0.08       0.45       0.08
##  [1] -155465.90       0.57       0.20       0.05       0.17       0.09
##  [7]       0.04       0.73       0.08       0.44       0.08
##  [1] -155448.90       0.57       0.20       0.05       0.17       0.09
##  [7]       0.04       0.73       0.08       0.44       0.08
##  [1] -155433.91       0.57       0.20       0.05       0.18       0.08
##  [7]       0.03       0.73       0.08       0.44       0.08
##  [1] -155420.85       0.57       0.20       0.05       0.18       0.08
##  [7]       0.03       0.73       0.08       0.44       0.08
##  [1] -155409.65       0.57       0.19       0.05       0.18       0.08
##  [7]       0.03       0.73       0.08       0.43       0.09
##  [1] -155400.20       0.57       0.19       0.06       0.19       0.08
##  [7]       0.03       0.73       0.08       0.43       0.09
## [1] 8
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160911.83       0.60       0.22       0.16       0.02       0.15
##  [7]       0.09       0.86       0.03       0.51       0.05
##  [1] -157017.47       0.64       0.19       0.14       0.03       0.17
##  [7]       0.09       0.83       0.03       0.53       0.05
##  [1] -156265.90       0.66       0.17       0.14       0.03       0.18
##  [7]       0.10       0.82       0.03       0.54       0.04
##  [1] -156048.24       0.66       0.16       0.14       0.04       0.18
##  [7]       0.10       0.81       0.03       0.54       0.04
##  [1] -156013.35       0.66       0.16       0.14       0.05       0.18
##  [7]       0.10       0.80       0.03       0.55       0.04
##  [1] -156040.19       0.65       0.15       0.14       0.05       0.19
##  [7]       0.10       0.79       0.03       0.55       0.04
##  [1] -156080.95       0.64       0.15       0.15       0.06       0.19
##  [7]       0.10       0.79       0.03       0.55       0.04
##  [1] -156117.44       0.63       0.15       0.15       0.06       0.19
##  [7]       0.10       0.79       0.04       0.55       0.04
##  [1] -156143.41       0.63       0.15       0.15       0.07       0.19
##  [7]       0.10       0.79       0.04       0.55       0.04
##  [1] -156158.45       0.62       0.16       0.16       0.07       0.19
##  [7]       0.10       0.79       0.04       0.55       0.04
##  [1] -156163.92       0.61       0.16       0.16       0.07       0.19
##  [7]       0.10       0.78       0.04       0.55       0.04
## [1] 9
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -161638.23       0.62       0.19       0.16       0.02       0.17
##  [7]       0.09       0.85       0.03       0.51       0.05
##  [1] -157142.69       0.67       0.16       0.14       0.03       0.20
##  [7]       0.10       0.83       0.03       0.53       0.04
##  [1] -156228.96       0.68       0.14       0.14       0.04       0.21
##  [7]       0.10       0.82       0.03       0.54       0.04
##  [1] -155950.29       0.68       0.13       0.14       0.05       0.22
##  [7]       0.10       0.81       0.03       0.54       0.04
##  [1] -155898.64       0.67       0.13       0.15       0.05       0.23
##  [7]       0.11       0.80       0.03       0.55       0.04
##  [1] -155929.48       0.66       0.13       0.15       0.06       0.24
##  [7]       0.11       0.79       0.03       0.55       0.04
##  [1] -155982.66       0.65       0.13       0.15       0.07       0.25
##  [7]       0.11       0.79       0.03       0.55       0.04
##  [1] -156033.41       0.64       0.13       0.16       0.07       0.25
##  [7]       0.11       0.79       0.04       0.55       0.04
##  [1] -156072.50       0.63       0.13       0.16       0.08       0.25
##  [7]       0.11       0.78       0.04       0.56       0.04
##  [1] -156098.63       0.62       0.14       0.16       0.08       0.25
##  [7]       0.11       0.78       0.04       0.56       0.04
##  [1] -156113.57       0.61       0.14       0.17       0.08       0.25
##  [7]       0.11       0.78       0.04       0.56       0.04
##  [1] -156119.65       0.60       0.14       0.17       0.09       0.26
##  [7]       0.11       0.78       0.04       0.56       0.04
## [1] 10
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -159328.07       0.58       0.22       0.18       0.02       0.15
##  [7]       0.09       0.88       0.04       0.51       0.05
##  [1] -157205.70       0.63       0.19       0.16       0.03       0.16
##  [7]       0.09       0.86       0.05       0.52       0.04
##  [1] -156780.59       0.65       0.17       0.15       0.03       0.17
##  [7]       0.10       0.85       0.05       0.53       0.04
##  [1] -156623.68       0.66       0.15       0.15       0.04       0.17
##  [7]       0.10       0.84       0.06       0.54       0.04
##  [1] -156571.96       0.66       0.15       0.15       0.04       0.17
##  [7]       0.10       0.83       0.06       0.54       0.04
##  [1] -156564.38       0.66       0.14       0.15       0.05       0.17
##  [7]       0.10       0.83       0.06       0.55       0.04
## [1] 11
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -159121.75       0.57       0.27       0.13       0.02       0.14
##  [7]       0.08       0.88       0.04       0.51       0.04
##  [1] -157128.16       0.62       0.25       0.10       0.03       0.15
##  [7]       0.08       0.86       0.05       0.52       0.04
##  [1] -156774.55       0.64       0.24       0.09       0.04       0.15
##  [7]       0.08       0.84       0.06       0.52       0.04
##  [1] -156614.88       0.65       0.23       0.08       0.04       0.15
##  [7]       0.08       0.83       0.06       0.53       0.04
##  [1] -156536.74       0.65       0.22       0.08       0.05       0.14
##  [7]       0.08       0.82       0.07       0.53       0.04
##  [1] -156500.39       0.65       0.22       0.07       0.06       0.14
##  [7]       0.08       0.81       0.07       0.53       0.04
##  [1] -156485.06       0.65       0.21       0.07       0.06       0.14
##  [7]       0.07       0.80       0.07       0.53       0.04
##  [1] -156478.36       0.65       0.21       0.07       0.07       0.14
##  [7]       0.07       0.80       0.07       0.53       0.04
## [1] 12
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -158970.73       0.57       0.17       0.24       0.02       0.16
##  [7]       0.09       0.87       0.03       0.52       0.05
##  [1] -155942.14       0.60       0.14       0.24       0.02       0.18
##  [7]       0.10       0.86       0.03       0.53       0.05
##  [1] -155480.73       0.61       0.12       0.24       0.03       0.19
##  [7]       0.10       0.85       0.03       0.54       0.04
##  [1] -155333.87       0.62       0.11       0.24       0.04       0.20
##  [7]       0.10       0.85       0.03       0.55       0.04
##  [1] -155281.81       0.62       0.10       0.24       0.04       0.21
##  [7]       0.11       0.85       0.03       0.56       0.04
##  [1] -155266.11       0.61       0.10       0.24       0.05       0.21
##  [7]       0.11       0.84       0.03       0.56       0.04
##  [1] -155264.73       0.61       0.10       0.24       0.05       0.21
##  [7]       0.11       0.84       0.03       0.56       0.04
## [1] 13
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160493.51       0.60       0.20       0.18       0.02       0.16
##  [7]       0.09       0.86       0.03       0.52       0.05
##  [1] -156901.58       0.64       0.16       0.17       0.03       0.18
##  [7]       0.10       0.84       0.03       0.53       0.04
##  [1] -156246.35       0.66       0.14       0.16       0.04       0.19
##  [7]       0.10       0.83       0.03       0.54       0.04
##  [1] -156042.13       0.66       0.13       0.16       0.04       0.20
##  [7]       0.11       0.82       0.03       0.54       0.04
##  [1] -155991.69       0.66       0.13       0.16       0.05       0.21
##  [7]       0.11       0.82       0.04       0.55       0.04
##  [1] -155998.34       0.65       0.12       0.17       0.06       0.21
##  [7]       0.11       0.81       0.04       0.55       0.04
## [1] 14
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -157985.66       0.55       0.15       0.29       0.02       0.17
##  [7]       0.09       0.88       0.03       0.52       0.05
##  [1] -155298.48       0.57       0.11       0.29       0.02       0.19
##  [7]       0.10       0.87       0.03       0.53       0.05
##  [1] -154875.77       0.58       0.09       0.30       0.03       0.21
##  [7]       0.10       0.86       0.03       0.54       0.04
##  [1] -154731.59       0.58       0.08       0.30       0.03       0.22
##  [7]       0.11       0.86       0.03       0.55       0.04
##  [1] -154675.01       0.58       0.08       0.30       0.04       0.23
##  [7]       0.11       0.86       0.03       0.55       0.04
##  [1] -154653.48       0.58       0.07       0.30       0.04       0.24
##  [7]       0.11       0.85       0.03       0.56       0.04
##  [1] -154646.39       0.58       0.07       0.31       0.05       0.24
##  [7]       0.12       0.85       0.04       0.56       0.04
## [1] 15
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160561.43       0.60       0.20       0.18       0.02       0.16
##  [7]       0.09       0.86       0.03       0.51       0.05
##  [1] -156955.27       0.64       0.17       0.17       0.03       0.18
##  [7]       0.09       0.84       0.03       0.52       0.05
##  [1] -156310.09       0.65       0.15       0.16       0.03       0.20
##  [7]       0.10       0.83       0.04       0.53       0.04
##  [1] -156116.99       0.66       0.14       0.16       0.04       0.21
##  [7]       0.10       0.82       0.04       0.54       0.04
##  [1] -156074.73       0.66       0.13       0.17       0.04       0.21
##  [7]       0.11       0.82       0.04       0.54       0.04
##  [1] -156085.66       0.65       0.13       0.17       0.05       0.22
##  [7]       0.11       0.81       0.04       0.55       0.04
##  [1] -156111.46       0.65       0.13       0.17       0.05       0.22
##  [7]       0.11       0.81       0.04       0.55       0.04
##  [1] -156137.18       0.64       0.13       0.17       0.06       0.22
##  [7]       0.11       0.81       0.04       0.55       0.04
##  [1] -156157.47       0.63       0.13       0.17       0.06       0.22
##  [7]       0.11       0.81       0.04       0.55       0.04
##  [1] -156171.15       0.63       0.13       0.18       0.06       0.22
##  [7]       0.11       0.81       0.04       0.55       0.04
##  [1] -156179.01       0.62       0.13       0.18       0.07       0.23
##  [7]       0.11       0.81       0.04       0.55       0.04
## [1] 16
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -158513.30       0.55       0.18       0.25       0.02       0.16
##  [7]       0.09       0.87       0.03       0.52       0.05
##  [1] -155719.03       0.59       0.15       0.24       0.02       0.17
##  [7]       0.10       0.86       0.03       0.53       0.05
##  [1] -155339.86       0.60       0.13       0.24       0.03       0.18
##  [7]       0.10       0.86       0.03       0.54       0.05
##  [1] -155213.01       0.61       0.12       0.24       0.03       0.19
##  [7]       0.10       0.85       0.03       0.55       0.04
##  [1] -155159.48       0.61       0.11       0.24       0.04       0.19
##  [7]       0.10       0.85       0.03       0.55       0.04
##  [1] -155135.64       0.60       0.11       0.24       0.04       0.20
##  [7]       0.11       0.85       0.03       0.56       0.04
##  [1] -155125.08       0.60       0.11       0.25       0.05       0.20
##  [7]       0.11       0.85       0.03       0.56       0.04
##  [1] -155120.02       0.60       0.11       0.25       0.05       0.20
##  [7]       0.11       0.85       0.03       0.57       0.04
## [1] 17
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -158305.37       0.55       0.16       0.27       0.02       0.16
##  [7]       0.09       0.87       0.03       0.52       0.05
##  [1] -155471.42       0.58       0.12       0.27       0.02       0.18
##  [7]       0.10       0.86       0.03       0.53       0.05
##  [1] -155064.01       0.60       0.11       0.27       0.03       0.20
##  [7]       0.11       0.86       0.03       0.54       0.04
##  [1] -154924.29       0.60       0.10       0.27       0.03       0.21
##  [7]       0.11       0.85       0.03       0.54       0.04
##  [1] -154863.56       0.60       0.09       0.27       0.04       0.22
##  [7]       0.12       0.85       0.03       0.55       0.04
##  [1] -154834.50       0.60       0.09       0.27       0.04       0.22
##  [7]       0.12       0.85       0.03       0.55       0.04
##  [1] -154819.06       0.59       0.08       0.28       0.05       0.23
##  [7]       0.12       0.85       0.03       0.56       0.04
##  [1] -154808.68       0.59       0.08       0.28       0.05       0.23
##  [7]       0.13       0.85       0.03       0.56       0.04
##  [1] -154799.06       0.58       0.08       0.28       0.06       0.24
##  [7]       0.13       0.85       0.03       0.56       0.04
## [1] 18
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -159623.23       0.58       0.17       0.23       0.02       0.17
##  [7]       0.09       0.87       0.03       0.52       0.05
##  [1] -156450.19       0.62       0.13       0.22       0.03       0.19
##  [7]       0.10       0.86       0.03       0.53       0.05
##  [1] -155855.67       0.64       0.11       0.22       0.03       0.21
##  [7]       0.11       0.85       0.03       0.54       0.04
##  [1] -155639.96       0.64       0.10       0.22       0.04       0.22
##  [7]       0.11       0.84       0.04       0.55       0.04
##  [1] -155563.14       0.64       0.10       0.22       0.04       0.23
##  [7]       0.12       0.84       0.04       0.56       0.04
##  [1] -155546.38       0.63       0.09       0.22       0.05       0.24
##  [7]       0.12       0.84       0.04       0.56       0.04
##  [1] -155554.75       0.63       0.09       0.23       0.05       0.25
##  [7]       0.12       0.83       0.04       0.57       0.04
## [1] 19
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -158766.69       0.56       0.16       0.26       0.02       0.17
##  [7]       0.09       0.87       0.03       0.52       0.05
##  [1] -155660.29       0.60       0.12       0.26       0.02       0.19
##  [7]       0.10       0.86       0.03       0.53       0.05
##  [1] -155177.48       0.61       0.10       0.26       0.03       0.21
##  [7]       0.11       0.85       0.03       0.54       0.04
##  [1] -155006.79       0.61       0.09       0.26       0.04       0.22
##  [7]       0.11       0.85       0.03       0.55       0.04
##  [1] -154936.92       0.61       0.09       0.27       0.04       0.23
##  [7]       0.12       0.85       0.03       0.55       0.04
##  [1] -154910.18       0.60       0.08       0.27       0.05       0.24
##  [7]       0.12       0.85       0.03       0.56       0.04
##  [1] -154902.65       0.60       0.08       0.27       0.05       0.25
##  [7]       0.13       0.85       0.03       0.56       0.04
## [1] 20
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160347.69       0.59       0.18       0.21       0.02       0.16
##  [7]       0.10       0.86       0.03       0.52       0.05
##  [1] -156638.86       0.63       0.14       0.20       0.03       0.18
##  [7]       0.10       0.84       0.03       0.53       0.05
##  [1] -155906.57       0.64       0.13       0.21       0.03       0.19
##  [7]       0.11       0.83       0.03       0.54       0.05
##  [1] -155700.05       0.64       0.11       0.21       0.04       0.20
##  [7]       0.11       0.82       0.03       0.55       0.05
##  [1] -155659.56       0.64       0.11       0.21       0.04       0.21
##  [7]       0.12       0.82       0.03       0.55       0.04
##  [1] -155672.32       0.63       0.10       0.22       0.04       0.22
##  [7]       0.12       0.82       0.04       0.56       0.04
##  [1] -155698.02       0.63       0.10       0.22       0.05       0.22
##  [7]       0.12       0.81       0.04       0.56       0.04
##  [1] -155722.63       0.62       0.10       0.22       0.05       0.22
##  [7]       0.13       0.81       0.04       0.56       0.04
##  [1] -155741.70       0.62       0.10       0.23       0.05       0.23
##  [7]       0.13       0.81       0.04       0.56       0.04
##  [1] -155754.60       0.61       0.10       0.23       0.06       0.23
##  [7]       0.13       0.81       0.04       0.56       0.04
##  [1] -155762.12       0.61       0.10       0.23       0.06       0.23
##  [7]       0.13       0.81       0.04       0.56       0.04
## [1] 21
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160298.78       0.59       0.18       0.22       0.02       0.16
##  [7]       0.09       0.86       0.03       0.52       0.05
##  [1] -156358.44       0.62       0.14       0.21       0.03       0.18
##  [7]       0.10       0.85       0.03       0.54       0.05
##  [1] -155618.23       0.63       0.12       0.22       0.03       0.19
##  [7]       0.10       0.83       0.03       0.55       0.04
##  [1] -155404.35       0.63       0.11       0.22       0.04       0.20
##  [7]       0.10       0.83       0.03       0.56       0.04
##  [1] -155364.82       0.63       0.10       0.23       0.04       0.20
##  [7]       0.10       0.82       0.04       0.57       0.04
##  [1] -155386.14       0.62       0.10       0.23       0.05       0.20
##  [7]       0.11       0.82       0.04       0.57       0.04
##  [1] -155424.14       0.61       0.10       0.24       0.05       0.21
##  [7]       0.11       0.82       0.04       0.58       0.04
##  [1] -155461.56       0.61       0.10       0.24       0.06       0.21
##  [7]       0.11       0.81       0.04       0.58       0.03
##  [1] -155492.38       0.60       0.10       0.24       0.06       0.21
##  [7]       0.11       0.81       0.04       0.58       0.03
##  [1] -155515.34       0.59       0.10       0.25       0.06       0.21
##  [7]       0.11       0.81       0.04       0.58       0.03
##  [1] -155531.28       0.59       0.10       0.25       0.07       0.21
##  [7]       0.11       0.81       0.04       0.58       0.03
##  [1] -155541.21       0.58       0.10       0.25       0.07       0.21
##  [7]       0.11       0.81       0.04       0.58       0.03
## [1] 22
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160906.11       0.60       0.21       0.17       0.02       0.16
##  [7]       0.09       0.86       0.04       0.52       0.05
##  [1] -157247.64       0.65       0.18       0.15       0.03       0.18
##  [7]       0.09       0.84       0.04       0.53       0.05
##  [1] -156509.64       0.66       0.16       0.14       0.03       0.19
##  [7]       0.09       0.83       0.04       0.54       0.04
##  [1] -156270.59       0.67       0.15       0.14       0.04       0.19
##  [7]       0.09       0.81       0.04       0.55       0.04
##  [1] -156220.83       0.67       0.14       0.15       0.05       0.20
##  [7]       0.09       0.81       0.04       0.55       0.04
##  [1] -156243.75       0.66       0.14       0.15       0.05       0.20
##  [7]       0.09       0.80       0.05       0.56       0.04
##  [1] -156287.76       0.65       0.14       0.15       0.06       0.20
##  [7]       0.09       0.79       0.05       0.56       0.04
##  [1] -156330.65       0.65       0.14       0.15       0.06       0.20
##  [7]       0.09       0.79       0.05       0.56       0.04
##  [1] -156364.11       0.64       0.14       0.16       0.06       0.20
##  [7]       0.09       0.79       0.05       0.56       0.04
##  [1] -156386.42       0.64       0.14       0.16       0.07       0.20
##  [7]       0.09       0.79       0.05       0.56       0.04
##  [1] -156398.51       0.63       0.14       0.16       0.07       0.20
##  [7]       0.09       0.79       0.05       0.56       0.04
##  [1] -156402.50       0.62       0.14       0.16       0.07       0.20
##  [7]       0.09       0.78       0.05       0.56       0.04
## [1] 23
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160598.48       0.59       0.23       0.15       0.02       0.15
##  [7]       0.09       0.86       0.03       0.52       0.05
##  [1] -156829.70       0.63       0.20       0.13       0.03       0.16
##  [7]       0.09       0.83       0.03       0.53       0.05
##  [1] -156139.69       0.65       0.19       0.13       0.03       0.16
##  [7]       0.09       0.82       0.03       0.54       0.04
##  [1] -155951.36       0.65       0.18       0.13       0.04       0.17
##  [7]       0.09       0.81       0.03       0.55       0.04
##  [1] -155932.23       0.65       0.17       0.14       0.05       0.17
##  [7]       0.09       0.80       0.03       0.55       0.04
##  [1] -155969.62       0.64       0.17       0.14       0.05       0.16
##  [7]       0.09       0.80       0.03       0.55       0.04
##  [1] -156019.01       0.63       0.17       0.14       0.06       0.16
##  [7]       0.09       0.79       0.03       0.55       0.04
##  [1] -156062.89       0.62       0.17       0.14       0.06       0.16
##  [7]       0.09       0.79       0.03       0.56       0.04
##  [1] -156094.85       0.62       0.17       0.15       0.07       0.16
##  [7]       0.09       0.79       0.03       0.56       0.04
##  [1] -156114.03       0.61       0.17       0.15       0.07       0.16
##  [7]       0.08       0.79       0.04       0.56       0.04
##  [1] -156121.68       0.60       0.17       0.15       0.08       0.16
##  [7]       0.08       0.79       0.04       0.56       0.04
## [1] 24
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -157324.85       0.52       0.32       0.14       0.02       0.13
##  [7]       0.07       0.89       0.04       0.50       0.05
##  [1] -155689.72       0.55       0.32       0.11       0.02       0.13
##  [7]       0.07       0.89       0.04       0.50       0.04
##  [1] -155671.43       0.56       0.32       0.09       0.03       0.13
##  [7]       0.06       0.89       0.04       0.50       0.04
##  [1] -155708.53       0.57       0.31       0.08       0.03       0.13
##  [7]       0.06       0.89       0.04       0.49       0.04
##  [1] -155747.70       0.58       0.30       0.08       0.04       0.13
##  [7]       0.06       0.89       0.04       0.49       0.04
##  [1] -155783.45       0.58       0.30       0.07       0.05       0.12
##  [7]       0.05       0.90       0.04       0.49       0.04
##  [1] -155814.94       0.59       0.29       0.07       0.05       0.12
##  [7]       0.05       0.90       0.04       0.49       0.04
##  [1] -155842.40       0.59       0.29       0.07       0.05       0.12
##  [7]       0.05       0.90       0.04       0.48       0.04
##  [1] -155864.93       0.59       0.29       0.07       0.06       0.11
##  [7]       0.05       0.90       0.03       0.48       0.04
##  [1] -155881.96       0.59       0.28       0.06       0.06       0.11
##  [7]       0.04       0.91       0.03       0.48       0.04
##  [1] -155894.36       0.59       0.28       0.06       0.07       0.11
##  [7]       0.04       0.91       0.03       0.47       0.04
##  [1] -155902.73       0.59       0.28       0.06       0.07       0.11
##  [7]       0.04       0.91       0.03       0.47       0.04
## [1] 25
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160447.86       0.60       0.27       0.11       0.02       0.15
##  [7]       0.08       0.86       0.04       0.51       0.05
##  [1] -157322.18       0.64       0.25       0.08       0.03       0.16
##  [7]       0.08       0.84       0.04       0.52       0.04
##  [1] -156700.27       0.65       0.24       0.07       0.04       0.16
##  [7]       0.08       0.81       0.05       0.53       0.04
##  [1] -156451.79       0.65       0.23       0.07       0.04       0.16
##  [7]       0.08       0.80       0.05       0.53       0.04
##  [1] -156373.45       0.65       0.23       0.07       0.05       0.16
##  [7]       0.08       0.78       0.05       0.54       0.04
##  [1] -156380.40       0.65       0.23       0.07       0.06       0.16
##  [7]       0.08       0.77       0.05       0.54       0.04
## [1] 26
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -159355.88       0.57       0.25       0.15       0.02       0.15
##  [7]       0.08       0.88       0.04       0.51       0.05
##  [1] -157168.48       0.62       0.23       0.12       0.03       0.16
##  [7]       0.08       0.86       0.05       0.52       0.04
##  [1] -156853.78       0.64       0.22       0.11       0.03       0.16
##  [7]       0.08       0.85       0.06       0.52       0.04
##  [1] -156731.38       0.65       0.21       0.10       0.04       0.16
##  [7]       0.08       0.84       0.06       0.52       0.04
##  [1] -156678.48       0.65       0.20       0.10       0.04       0.16
##  [7]       0.08       0.84       0.07       0.53       0.04
##  [1] -156656.20       0.66       0.20       0.10       0.05       0.16
##  [7]       0.08       0.83       0.07       0.53       0.04
##  [1] -156647.03       0.66       0.19       0.10       0.05       0.16
##  [7]       0.08       0.83       0.07       0.53       0.04
ggplot(sampleinfo_organoid_fetal, aes(as.numeric(as.character(passage.or.rescope.no_numeric)), thresholded_prior_ratio))+
  geom_point(size=2,shape=21,color="black",aes(fill=as.factor(passage.or.rescope.no_numeric)))+xlab("Passage")+
  ylab("Intermediate Peak Prior")+theme_bw()+theme(axis.title = element_text(size=12))+
  #geom_text(aes(label=count, vjust=vjust, hjust=hjust), color="grey40", size=3)+
  scale_x_continuous(breaks=c(1,2,3,4,6,7,8,2,4,10,11,14,16))+ scale_fill_manual(values=pass_col,name="Passage\nNumber", guide=F)

ggsave(here("figs","MTAB4957_fetal_mixture_model_ratio_maximize.pdf"), width=3, height=2)


sampleinfo_organoid_fetal$thresholded_ratio_max<-F
sampleinfo_organoid_fetal$thresholded_ratio_max[which(sampleinfo_organoid_fetal$thresholded_prior_ratio>1)]<-T

percent_passing<-round((tapply(sampleinfo_organoid_fetal$thresholded_ratio_max, sampleinfo_organoid_fetal$passage.or.rescope.no_numeric, sum)/tapply(sampleinfo_organoid_fetal$array.id, sampleinfo_organoid_fetal$passage.or.rescope.no_numeric, length))*100,2)
passed_num<-tapply(sampleinfo_organoid_fetal$thresholded_ratio_max, sampleinfo_organoid_fetal$passage.or.rescope.no_numeric, sum)
org_numer<-tapply(sampleinfo_organoid_fetal$array.id, sampleinfo_organoid_fetal$passage.or.rescope.no_numeric, length)

df<-data.frame(passage=names(percent_passing), passing=percent_passing, pro_passing=percent_passing/100, count=org_numer, passed_num=passed_num)
df$passage.factor <- factor(df$passage, levels = c(23,21,14,12,9,7,6,5,3,2,1))


df<-cbind(df,(binom.confint(df$passed_num, df$count, method="exact", conf.level=0.95)))
df$upper<-df$upper*100
df$lower<-df$lower*100

print(df)
##    passage passing pro_passing count passed_num passage.factor method x n
## 1        1       0         0.0     4          0              1  exact 0 4
## 2        2       0         0.0     5          0              2  exact 0 5
## 3        3       0         0.0     3          0              3  exact 0 3
## 5        5       0         0.0     2          0              5  exact 0 2
## 6        6       0         0.0     2          0              6  exact 0 2
## 7        7       0         0.0     2          0              7  exact 0 2
## 9        9       0         0.0     2          0              9  exact 0 2
## 12      12       0         0.0     1          0             12  exact 0 1
## 14      14      50         0.5     2          1             14  exact 1 2
## 21      21       0         0.0     1          0             21  exact 0 1
## 23      23       0         0.0     2          0             23  exact 0 2
##    mean    lower    upper
## 1   0.0 0.000000 60.23646
## 2   0.0 0.000000 52.18238
## 3   0.0 0.000000 70.75982
## 5   0.0 0.000000 84.18861
## 6   0.0 0.000000 84.18861
## 7   0.0 0.000000 84.18861
## 9   0.0 0.000000 84.18861
## 12  0.0 0.000000 97.50000
## 14  0.5 1.257912 98.74209
## 21  0.0 0.000000 97.50000
## 23  0.0 0.000000 84.18861
ggplot(df, aes(as.numeric(as.character(passage)), passing))+
  geom_errorbar(aes(ymin=lower, ymax=upper), colour="grey70", width=.25)+
  geom_line(color="grey20")+geom_point(size=1.25,shape=21,color="black",aes(fill=passage.factor))+xlab("Passage")+
  ylab("Samples with Trimodal\nDistribution (%)")+theme_bw()+theme(axis.title = element_text(size=10))+
  scale_x_continuous(breaks=c(1,2,3,4,6,7,8,2,4,10,11,14,16))+ scale_fill_manual(values=pass_col,name="Passage\nNumber", guide=F)

ggsave(here("figs","MTAB4957_fetal_mixture_model_ratio_threshold_maximize.pdf"), width=3, height=2)


## plot all samples
plts_paired<-lapply(1:nrow(sampleinfo_organoid_fetal), function(x){
  print(x)
  passage<-paste("passage: ",sampleinfo_organoid_fetal$passage.or.rescope.no_numeric[x],"\nIndividual: ", sampleinfo_organoid_fetal$Characteristics.individual.[x],"\nRatio I/H: " ,round(sampleinfo_organoid_fetal$thresholded_prior_ratio[x],2), sep="")
  converted<-as.numeric(round(MTAB4957_beta_VeryVariable[,x]*1000,0))
  counts<-rep(1000, length(converted))
  res = em(converted, counts, .41, .31, .27, 0.01, .1, .1, .90, .03, .5, .05)
  draw_fit_params_gg(converted, counts, res,passage)
})
## [1] 1
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -157952.80       0.56       0.28       0.14       0.02       0.14
##  [7]       0.09       0.89       0.04       0.50       0.04
##  [1] -156698.25       0.60       0.27       0.11       0.03       0.15
##  [7]       0.09       0.88       0.04       0.50       0.04
##  [1] -156685.93       0.62       0.26       0.09       0.04       0.15
##  [7]       0.09       0.88       0.05       0.50       0.03
##  [1] -156733.66       0.63       0.25       0.08       0.05       0.15
##  [7]       0.09       0.88       0.05       0.50       0.03
##  [1] -156784.92       0.63       0.24       0.07       0.05       0.15
##  [7]       0.09       0.88       0.05       0.50       0.03
##  [1] -156828.44       0.63       0.24       0.07       0.06       0.15
##  [7]       0.09       0.88       0.05       0.50       0.03
##  [1] -156863.15       0.63       0.24       0.06       0.07       0.15
##  [7]       0.09       0.88       0.04       0.50       0.03
##  [1] -156890.89       0.63       0.23       0.06       0.07       0.14
##  [7]       0.08       0.88       0.04       0.50       0.03
##  [1] -156912.20       0.63       0.23       0.06       0.08       0.14
##  [7]       0.08       0.88       0.04       0.50       0.03
##  [1] -156929.66       0.63       0.23       0.06       0.08       0.14
##  [7]       0.08       0.89       0.04       0.50       0.03
##  [1] -156944.50       0.63       0.23       0.06       0.09       0.14
##  [7]       0.08       0.89       0.04       0.50       0.03
##  [1] -156957.82       0.62       0.23       0.06       0.09       0.13
##  [7]       0.07       0.89       0.04       0.50       0.03
##  [1] -156970.26       0.62       0.22       0.06       0.09       0.13
##  [7]       0.07       0.89       0.03       0.50       0.04
##  [1] -156982.27       0.62       0.22       0.06       0.10       0.13
##  [7]       0.07       0.89       0.03       0.50       0.04
##  [1] -156994.24       0.62       0.22       0.06       0.10       0.13
##  [7]       0.07       0.89       0.03       0.50       0.04
##  [1] -157006.40       0.62       0.22       0.06       0.11       0.12
##  [7]       0.07       0.90       0.03       0.49       0.04
##  [1] -157018.95       0.62       0.22       0.06       0.11       0.12
##  [7]       0.06       0.90       0.03       0.49       0.04
##  [1] -157032.07       0.62       0.22       0.06       0.11       0.12
##  [7]       0.06       0.90       0.03       0.49       0.04
##  [1] -157046.11       0.61       0.21       0.06       0.12       0.12
##  [7]       0.06       0.90       0.03       0.49       0.05
##  [1] -157060.79       0.61       0.21       0.06       0.12       0.12
##  [7]       0.06       0.90       0.03       0.49       0.05
##  [1] -157076.20       0.61       0.21       0.06       0.12       0.11
##  [7]       0.06       0.90       0.03       0.49       0.05
##  [1] -157092.33       0.61       0.21       0.06       0.13       0.11
##  [7]       0.05       0.90       0.02       0.48       0.05
##  [1] -157109.19       0.61       0.21       0.06       0.13       0.11
##  [7]       0.05       0.91       0.02       0.48       0.05
##  [1] -157127.55       0.61       0.21       0.06       0.13       0.11
##  [7]       0.05       0.91       0.02       0.48       0.06
##  [1] -157146.52       0.61       0.20       0.06       0.13       0.11
##  [7]       0.05       0.91       0.02       0.48       0.06
##  [1] -157166.10       0.61       0.20       0.05       0.14       0.11
##  [7]       0.05       0.91       0.02       0.48       0.06
##  [1] -157186.25       0.60       0.20       0.05       0.14       0.10
##  [7]       0.05       0.91       0.02       0.47       0.06
##  [1] -157206.95       0.60       0.20       0.05       0.14       0.10
##  [7]       0.04       0.91       0.02       0.47       0.06
##  [1] -157228.14       0.60       0.20       0.05       0.15       0.10
##  [7]       0.04       0.91       0.02       0.47       0.07
##  [1] -157249.76       0.60       0.19       0.05       0.15       0.10
##  [7]       0.04       0.91       0.02       0.47       0.07
##  [1] -157271.76       0.60       0.19       0.05       0.15       0.10
##  [7]       0.04       0.91       0.02       0.47       0.07
##  [1] -157294.09       0.60       0.19       0.05       0.16       0.10
##  [7]       0.04       0.91       0.02       0.46       0.07
##  [1] -157316.67       0.60       0.19       0.05       0.16       0.09
##  [7]       0.04       0.91       0.02       0.46       0.08
##  [1] -157339.47       0.60       0.19       0.05       0.16       0.09
##  [7]       0.04       0.91       0.02       0.46       0.08
##  [1] -157362.41       0.59       0.19       0.05       0.17       0.09
##  [7]       0.03       0.91       0.02       0.46       0.08
##  [1] -157383.97       0.59       0.18       0.05       0.17       0.09
##  [7]       0.03       0.91       0.02       0.46       0.08
##  [1] -157405.81       0.59       0.18       0.05       0.17       0.09
##  [7]       0.03       0.91       0.02       0.46       0.08
##  [1] -157427.80       0.59       0.18       0.05       0.17       0.09
##  [7]       0.03       0.91       0.02       0.45       0.09
##  [1] -157449.85       0.59       0.18       0.05       0.18       0.09
##  [7]       0.03       0.92       0.02       0.45       0.09
##  [1] -157471.88       0.59       0.18       0.05       0.18       0.09
##  [7]       0.03       0.92       0.02       0.45       0.09
##  [1] -157493.85       0.59       0.18       0.05       0.18       0.09
##  [7]       0.03       0.92       0.02       0.45       0.09
##  [1] -157515.72       0.58       0.18       0.05       0.19       0.08
##  [7]       0.03       0.92       0.02       0.45       0.10
##  [1] -157537.45       0.58       0.18       0.05       0.19       0.08
##  [7]       0.03       0.92       0.02       0.45       0.10
##  [1] -157559.01       0.58       0.17       0.05       0.19       0.08
##  [7]       0.03       0.92       0.02       0.45       0.10
##  [1] -157580.39       0.58       0.17       0.05       0.19       0.08
##  [7]       0.03       0.92       0.02       0.44       0.10
##  [1] -157601.56       0.58       0.17       0.05       0.20       0.08
##  [7]       0.03       0.92       0.02       0.44       0.10
##  [1] -157622.51       0.58       0.17       0.05       0.20       0.08
##  [7]       0.03       0.92       0.02       0.44       0.11
##  [1] -157643.23       0.57       0.17       0.05       0.20       0.08
##  [7]       0.03       0.92       0.02       0.44       0.11
##  [1] -157663.67       0.57       0.17       0.05       0.21       0.08
##  [7]       0.02       0.92       0.02       0.44       0.11
##  [1] -157683.93       0.57       0.17       0.05       0.21       0.08
##  [7]       0.02       0.92       0.02       0.44       0.11
##  [1] -157703.91       0.57       0.17       0.05       0.21       0.08
##  [7]       0.02       0.92       0.02       0.44       0.12
##  [1] -157723.64       0.57       0.17       0.05       0.22       0.08
##  [7]       0.02       0.92       0.02       0.44       0.12
##  [1] -157743.11       0.56       0.16       0.05       0.22       0.08
##  [7]       0.02       0.92       0.02       0.44       0.12
##  [1] -157762.32       0.56       0.16       0.05       0.22       0.08
##  [7]       0.02       0.92       0.02       0.43       0.12
##  [1] -157781.27       0.56       0.16       0.05       0.22       0.08
##  [7]       0.02       0.92       0.02       0.43       0.12
##  [1] -157799.96       0.56       0.16       0.06       0.23       0.08
##  [7]       0.02       0.92       0.02       0.43       0.13
##  [1] -157818.40       0.55       0.16       0.06       0.23       0.07
##  [7]       0.02       0.92       0.02       0.43       0.13
##  [1] -157834.71       0.55       0.16       0.06       0.23       0.07
##  [7]       0.02       0.92       0.02       0.43       0.13
##  [1] -157851.11       0.55       0.16       0.06       0.24       0.07
##  [7]       0.02       0.92       0.02       0.43       0.13
##  [1] -157867.58       0.55       0.16       0.06       0.24       0.07
##  [7]       0.02       0.92       0.02       0.43       0.13
##  [1] -157884.01       0.54       0.16       0.06       0.24       0.07
##  [7]       0.02       0.92       0.02       0.43       0.14
##  [1] -157901.25       0.54       0.16       0.06       0.25       0.07
##  [7]       0.02       0.92       0.02       0.43       0.14
##  [1] -157917.48       0.54       0.16       0.06       0.25       0.07
##  [7]       0.02       0.92       0.02       0.43       0.14
##  [1] -157934.18       0.53       0.16       0.06       0.25       0.07
##  [7]       0.02       0.92       0.02       0.43       0.14
##  [1] -157950.71       0.53       0.16       0.06       0.26       0.07
##  [7]       0.02       0.92       0.02       0.43       0.14
##  [1] -157966.87       0.53       0.15       0.06       0.26       0.07
##  [7]       0.02       0.92       0.02       0.43       0.15
##  [1] -157982.65       0.53       0.15       0.06       0.26       0.07
##  [7]       0.02       0.92       0.02       0.43       0.15
##  [1] -157998.21       0.52       0.15       0.06       0.27       0.07
##  [7]       0.02       0.92       0.02       0.43       0.15
##  [1] -158013.41       0.52       0.15       0.06       0.27       0.07
##  [7]       0.02       0.92       0.02       0.43       0.15
##  [1] -158028.30       0.52       0.15       0.06       0.27       0.07
##  [7]       0.02       0.92       0.02       0.43       0.15
##  [1] -158042.86       0.51       0.15       0.06       0.28       0.07
##  [7]       0.02       0.92       0.02       0.43       0.15
##  [1] -158057.09       0.51       0.15       0.06       0.28       0.07
##  [7]       0.02       0.92       0.02       0.43       0.16
##  [1] -158070.99       0.51       0.15       0.06       0.28       0.07
##  [7]       0.02       0.92       0.02       0.43       0.16
##  [1] -158084.55       0.50       0.15       0.06       0.29       0.07
##  [7]       0.02       0.92       0.02       0.43       0.16
##  [1] -158097.78       0.50       0.15       0.06       0.29       0.07
##  [7]       0.02       0.92       0.02       0.43       0.16
##  [1] -158110.65       0.50       0.15       0.06       0.29       0.07
##  [7]       0.02       0.92       0.02       0.43       0.16
##  [1] -158123.16       0.49       0.15       0.06       0.30       0.07
##  [7]       0.02       0.92       0.02       0.43       0.16
##  [1] -158135.34       0.49       0.15       0.06       0.30       0.07
##  [7]       0.02       0.92       0.02       0.43       0.16
##  [1] -158147.16       0.49       0.15       0.06       0.30       0.07
##  [7]       0.02       0.92       0.02       0.43       0.17
##  [1] -158158.39       0.48       0.15       0.06       0.31       0.07
##  [7]       0.02       0.92       0.02       0.43       0.17
##  [1] -158169.94       0.48       0.15       0.06       0.31       0.07
##  [7]       0.02       0.92       0.02       0.43       0.17
##  [1] -158180.40       0.48       0.15       0.06       0.32       0.07
##  [7]       0.02       0.92       0.02       0.43       0.17
##  [1] -158191.34       0.47       0.15       0.06       0.32       0.07
##  [7]       0.02       0.92       0.02       0.43       0.17
##  [1] -158200.68       0.47       0.15       0.06       0.32       0.07
##  [7]       0.02       0.92       0.02       0.43       0.17
## [1] 2
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -159957.90       0.58       0.16       0.24       0.02       0.17
##  [7]       0.10       0.87       0.03       0.52       0.05
##  [1] -156264.73       0.62       0.12       0.24       0.03       0.19
##  [7]       0.11       0.85       0.03       0.54       0.05
##  [1] -155514.48       0.62       0.10       0.25       0.03       0.21
##  [7]       0.11       0.84       0.03       0.55       0.04
##  [1] -155286.99       0.62       0.09       0.25       0.04       0.23
##  [7]       0.12       0.83       0.03       0.56       0.04
##  [1] -155230.55       0.62       0.08       0.26       0.04       0.24
##  [7]       0.12       0.83       0.03       0.56       0.04
##  [1] -155236.15       0.61       0.08       0.26       0.05       0.25
##  [7]       0.13       0.83       0.04       0.57       0.04
## [1] 3
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -156851.65       0.52       0.33       0.14       0.02       0.13
##  [7]       0.08       0.90       0.04       0.49       0.04
##  [1] -155670.41       0.54       0.33       0.11       0.02       0.13
##  [7]       0.08       0.90       0.04       0.49       0.04
##  [1] -155746.33       0.56       0.32       0.09       0.03       0.13
##  [7]       0.08       0.90       0.04       0.49       0.04
##  [1] -155871.81       0.56       0.32       0.08       0.03       0.13
##  [7]       0.08       0.91       0.04       0.48       0.03
##  [1] -155999.20       0.57       0.31       0.08       0.04       0.13
##  [7]       0.08       0.91       0.04       0.48       0.03
##  [1] -156117.45       0.57       0.31       0.08       0.05       0.13
##  [7]       0.07       0.91       0.03       0.48       0.03
##  [1] -156221.30       0.57       0.31       0.07       0.05       0.13
##  [7]       0.07       0.92       0.03       0.47       0.03
##  [1] -156307.54       0.57       0.30       0.07       0.06       0.13
##  [7]       0.07       0.92       0.03       0.47       0.03
##  [1] -156375.50       0.57       0.30       0.07       0.06       0.12
##  [7]       0.07       0.92       0.03       0.47       0.03
##  [1] -156424.53       0.57       0.30       0.07       0.06       0.12
##  [7]       0.07       0.92       0.02       0.47       0.03
##  [1] -156456.09       0.57       0.30       0.07       0.07       0.12
##  [7]       0.06       0.93       0.02       0.46       0.03
##  [1] -156472.42       0.56       0.30       0.07       0.07       0.12
##  [7]       0.06       0.93       0.02       0.46       0.03
##  [1] -156474.93       0.56       0.29       0.07       0.08       0.12
##  [7]       0.06       0.93       0.02       0.46       0.03
## [1] 4
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -155944.91       0.46       0.43       0.10       0.01       0.12
##  [7]       0.06       0.89       0.04       0.48       0.05
##  [1] -153982.54       0.45       0.47       0.07       0.01       0.12
##  [7]       0.06       0.90       0.04       0.47       0.04
##  [1] -153857.92       0.44       0.48       0.06       0.02       0.12
##  [7]       0.06       0.90       0.04       0.46       0.04
##  [1] -153888.03       0.44       0.49       0.05       0.02       0.12
##  [7]       0.06       0.90       0.04       0.45       0.04
##  [1] -153959.91       0.44       0.49       0.05       0.02       0.12
##  [7]       0.06       0.91       0.03       0.45       0.04
##  [1] -154040.24       0.44       0.49       0.04       0.03       0.12
##  [7]       0.06       0.91       0.03       0.44       0.03
##  [1] -154113.45       0.44       0.48       0.04       0.03       0.12
##  [7]       0.06       0.91       0.03       0.43       0.03
##  [1] -154171.74       0.44       0.48       0.04       0.03       0.12
##  [7]       0.06       0.91       0.03       0.43       0.03
##  [1] -154211.24       0.44       0.48       0.04       0.04       0.11
##  [7]       0.06       0.92       0.02       0.42       0.03
##  [1] -154230.92       0.44       0.48       0.04       0.04       0.11
##  [7]       0.05       0.92       0.02       0.42       0.03
##  [1] -154231.47       0.43       0.48       0.04       0.05       0.11
##  [7]       0.05       0.92       0.02       0.42       0.03
## [1] 5
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -156833.58       0.51       0.39       0.09       0.02       0.12
##  [7]       0.07       0.88       0.04       0.49       0.04
##  [1] -155288.23       0.51       0.41       0.05       0.02       0.12
##  [7]       0.07       0.88       0.04       0.48       0.04
##  [1] -155206.60       0.52       0.42       0.04       0.03       0.12
##  [7]       0.07       0.88       0.04       0.47       0.03
##  [1] -155226.02       0.52       0.42       0.03       0.04       0.12
##  [7]       0.07       0.88       0.04       0.46       0.03
##  [1] -155267.09       0.52       0.41       0.02       0.04       0.12
##  [7]       0.07       0.88       0.04       0.46       0.03
##  [1] -155306.10       0.51       0.41       0.02       0.05       0.12
##  [7]       0.07       0.88       0.04       0.45       0.03
##  [1] -155334.58       0.51       0.41       0.02       0.06       0.12
##  [7]       0.07       0.88       0.04       0.45       0.03
##  [1] -155350.38       0.50       0.41       0.02       0.07       0.12
##  [7]       0.06       0.88       0.04       0.45       0.03
##  [1] -155354.20       0.50       0.41       0.02       0.08       0.12
##  [7]       0.06       0.89       0.03       0.44       0.03
## [1] 6
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -157509.21       0.54       0.25       0.19       0.02       0.13
##  [7]       0.09       0.88       0.04       0.51       0.04
##  [1] -156289.32       0.59       0.22       0.17       0.03       0.13
##  [7]       0.09       0.87       0.04       0.52       0.04
##  [1] -156129.04       0.61       0.20       0.15       0.03       0.13
##  [7]       0.08       0.87       0.05       0.53       0.04
##  [1] -156091.06       0.62       0.19       0.15       0.04       0.13
##  [7]       0.08       0.86       0.05       0.53       0.03
##  [1] -156095.91       0.62       0.19       0.15       0.04       0.12
##  [7]       0.08       0.86       0.05       0.53       0.03
## [1] 7
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -158735.16       0.57       0.29       0.11       0.02       0.13
##  [7]       0.09       0.87       0.04       0.50       0.04
##  [1] -157153.62       0.62       0.28       0.08       0.03       0.14
##  [7]       0.09       0.86       0.05       0.51       0.04
##  [1] -156846.37       0.63       0.27       0.06       0.04       0.15
##  [7]       0.09       0.84       0.06       0.51       0.04
##  [1] -156673.36       0.64       0.26       0.05       0.05       0.15
##  [7]       0.10       0.83       0.06       0.51       0.04
##  [1] -156555.97       0.64       0.25       0.05       0.06       0.15
##  [7]       0.09       0.81       0.07       0.51       0.04
##  [1] -156470.97       0.64       0.25       0.04       0.06       0.14
##  [7]       0.09       0.80       0.07       0.51       0.03
##  [1] -156406.80       0.64       0.25       0.04       0.07       0.14
##  [7]       0.09       0.79       0.07       0.51       0.04
##  [1] -156355.33       0.64       0.25       0.04       0.08       0.14
##  [7]       0.09       0.78       0.07       0.51       0.04
##  [1] -156311.68       0.63       0.25       0.04       0.08       0.14
##  [7]       0.09       0.78       0.07       0.51       0.04
##  [1] -156272.32       0.63       0.24       0.04       0.09       0.14
##  [7]       0.08       0.77       0.08       0.51       0.04
##  [1] -156234.85       0.63       0.24       0.04       0.09       0.13
##  [7]       0.08       0.76       0.08       0.51       0.04
##  [1] -156197.68       0.62       0.24       0.04       0.10       0.13
##  [7]       0.08       0.76       0.08       0.50       0.04
##  [1] -156159.84       0.62       0.24       0.04       0.10       0.13
##  [7]       0.08       0.76       0.08       0.50       0.04
##  [1] -156120.89       0.62       0.24       0.04       0.10       0.13
##  [7]       0.07       0.75       0.08       0.50       0.04
##  [1] -156080.77       0.61       0.24       0.04       0.11       0.12
##  [7]       0.07       0.75       0.08       0.50       0.04
##  [1] -156039.62       0.61       0.24       0.04       0.11       0.12
##  [7]       0.07       0.75       0.08       0.50       0.05
##  [1] -155997.75       0.61       0.23       0.04       0.12       0.12
##  [7]       0.07       0.74       0.08       0.49       0.05
##  [1] -155955.50       0.61       0.23       0.04       0.12       0.12
##  [7]       0.07       0.74       0.08       0.49       0.05
##  [1] -155913.25       0.60       0.23       0.04       0.12       0.11
##  [7]       0.06       0.74       0.08       0.49       0.05
##  [1] -155871.36       0.60       0.23       0.04       0.13       0.11
##  [7]       0.06       0.74       0.08       0.48       0.05
##  [1] -155830.18       0.60       0.23       0.04       0.13       0.11
##  [7]       0.06       0.74       0.08       0.48       0.06
##  [1] -155790.02       0.60       0.22       0.05       0.13       0.11
##  [7]       0.06       0.74       0.08       0.48       0.06
##  [1] -155751.15       0.60       0.22       0.05       0.14       0.11
##  [7]       0.05       0.74       0.08       0.47       0.06
##  [1] -155713.78       0.59       0.22       0.05       0.14       0.10
##  [7]       0.05       0.74       0.08       0.47       0.06
##  [1] -155678.12       0.59       0.22       0.05       0.14       0.10
##  [7]       0.05       0.73       0.08       0.47       0.06
##  [1] -155644.30       0.59       0.22       0.05       0.15       0.10
##  [7]       0.05       0.73       0.08       0.47       0.06
##  [1] -155612.46       0.59       0.21       0.05       0.15       0.10
##  [7]       0.05       0.73       0.08       0.46       0.07
##  [1] -155582.68       0.58       0.21       0.05       0.15       0.10
##  [7]       0.05       0.73       0.08       0.46       0.07
##  [1] -155555.02       0.58       0.21       0.05       0.16       0.09
##  [7]       0.04       0.73       0.08       0.46       0.07
##  [1] -155529.53       0.58       0.21       0.05       0.16       0.09
##  [7]       0.04       0.73       0.08       0.45       0.07
##  [1] -155506.18       0.58       0.21       0.05       0.16       0.09
##  [7]       0.04       0.73       0.08       0.45       0.07
##  [1] -155484.98       0.58       0.20       0.05       0.17       0.09
##  [7]       0.04       0.73       0.08       0.45       0.08
##  [1] -155465.90       0.57       0.20       0.05       0.17       0.09
##  [7]       0.04       0.73       0.08       0.44       0.08
##  [1] -155448.90       0.57       0.20       0.05       0.17       0.09
##  [7]       0.04       0.73       0.08       0.44       0.08
##  [1] -155433.91       0.57       0.20       0.05       0.18       0.08
##  [7]       0.03       0.73       0.08       0.44       0.08
##  [1] -155420.85       0.57       0.20       0.05       0.18       0.08
##  [7]       0.03       0.73       0.08       0.44       0.08
##  [1] -155409.65       0.57       0.19       0.05       0.18       0.08
##  [7]       0.03       0.73       0.08       0.43       0.09
##  [1] -155400.20       0.57       0.19       0.06       0.19       0.08
##  [7]       0.03       0.73       0.08       0.43       0.09
## [1] 8
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160911.83       0.60       0.22       0.16       0.02       0.15
##  [7]       0.09       0.86       0.03       0.51       0.05
##  [1] -157017.47       0.64       0.19       0.14       0.03       0.17
##  [7]       0.09       0.83       0.03       0.53       0.05
##  [1] -156265.90       0.66       0.17       0.14       0.03       0.18
##  [7]       0.10       0.82       0.03       0.54       0.04
##  [1] -156048.24       0.66       0.16       0.14       0.04       0.18
##  [7]       0.10       0.81       0.03       0.54       0.04
##  [1] -156013.35       0.66       0.16       0.14       0.05       0.18
##  [7]       0.10       0.80       0.03       0.55       0.04
##  [1] -156040.19       0.65       0.15       0.14       0.05       0.19
##  [7]       0.10       0.79       0.03       0.55       0.04
##  [1] -156080.95       0.64       0.15       0.15       0.06       0.19
##  [7]       0.10       0.79       0.03       0.55       0.04
##  [1] -156117.44       0.63       0.15       0.15       0.06       0.19
##  [7]       0.10       0.79       0.04       0.55       0.04
##  [1] -156143.41       0.63       0.15       0.15       0.07       0.19
##  [7]       0.10       0.79       0.04       0.55       0.04
##  [1] -156158.45       0.62       0.16       0.16       0.07       0.19
##  [7]       0.10       0.79       0.04       0.55       0.04
##  [1] -156163.92       0.61       0.16       0.16       0.07       0.19
##  [7]       0.10       0.78       0.04       0.55       0.04
## [1] 9
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -161638.23       0.62       0.19       0.16       0.02       0.17
##  [7]       0.09       0.85       0.03       0.51       0.05
##  [1] -157142.69       0.67       0.16       0.14       0.03       0.20
##  [7]       0.10       0.83       0.03       0.53       0.04
##  [1] -156228.96       0.68       0.14       0.14       0.04       0.21
##  [7]       0.10       0.82       0.03       0.54       0.04
##  [1] -155950.29       0.68       0.13       0.14       0.05       0.22
##  [7]       0.10       0.81       0.03       0.54       0.04
##  [1] -155898.64       0.67       0.13       0.15       0.05       0.23
##  [7]       0.11       0.80       0.03       0.55       0.04
##  [1] -155929.48       0.66       0.13       0.15       0.06       0.24
##  [7]       0.11       0.79       0.03       0.55       0.04
##  [1] -155982.66       0.65       0.13       0.15       0.07       0.25
##  [7]       0.11       0.79       0.03       0.55       0.04
##  [1] -156033.41       0.64       0.13       0.16       0.07       0.25
##  [7]       0.11       0.79       0.04       0.55       0.04
##  [1] -156072.50       0.63       0.13       0.16       0.08       0.25
##  [7]       0.11       0.78       0.04       0.56       0.04
##  [1] -156098.63       0.62       0.14       0.16       0.08       0.25
##  [7]       0.11       0.78       0.04       0.56       0.04
##  [1] -156113.57       0.61       0.14       0.17       0.08       0.25
##  [7]       0.11       0.78       0.04       0.56       0.04
##  [1] -156119.65       0.60       0.14       0.17       0.09       0.26
##  [7]       0.11       0.78       0.04       0.56       0.04
## [1] 10
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -159328.07       0.58       0.22       0.18       0.02       0.15
##  [7]       0.09       0.88       0.04       0.51       0.05
##  [1] -157205.70       0.63       0.19       0.16       0.03       0.16
##  [7]       0.09       0.86       0.05       0.52       0.04
##  [1] -156780.59       0.65       0.17       0.15       0.03       0.17
##  [7]       0.10       0.85       0.05       0.53       0.04
##  [1] -156623.68       0.66       0.15       0.15       0.04       0.17
##  [7]       0.10       0.84       0.06       0.54       0.04
##  [1] -156571.96       0.66       0.15       0.15       0.04       0.17
##  [7]       0.10       0.83       0.06       0.54       0.04
##  [1] -156564.38       0.66       0.14       0.15       0.05       0.17
##  [7]       0.10       0.83       0.06       0.55       0.04
## [1] 11
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -159121.75       0.57       0.27       0.13       0.02       0.14
##  [7]       0.08       0.88       0.04       0.51       0.04
##  [1] -157128.16       0.62       0.25       0.10       0.03       0.15
##  [7]       0.08       0.86       0.05       0.52       0.04
##  [1] -156774.55       0.64       0.24       0.09       0.04       0.15
##  [7]       0.08       0.84       0.06       0.52       0.04
##  [1] -156614.88       0.65       0.23       0.08       0.04       0.15
##  [7]       0.08       0.83       0.06       0.53       0.04
##  [1] -156536.74       0.65       0.22       0.08       0.05       0.14
##  [7]       0.08       0.82       0.07       0.53       0.04
##  [1] -156500.39       0.65       0.22       0.07       0.06       0.14
##  [7]       0.08       0.81       0.07       0.53       0.04
##  [1] -156485.06       0.65       0.21       0.07       0.06       0.14
##  [7]       0.07       0.80       0.07       0.53       0.04
##  [1] -156478.36       0.65       0.21       0.07       0.07       0.14
##  [7]       0.07       0.80       0.07       0.53       0.04
## [1] 12
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -158970.73       0.57       0.17       0.24       0.02       0.16
##  [7]       0.09       0.87       0.03       0.52       0.05
##  [1] -155942.14       0.60       0.14       0.24       0.02       0.18
##  [7]       0.10       0.86       0.03       0.53       0.05
##  [1] -155480.73       0.61       0.12       0.24       0.03       0.19
##  [7]       0.10       0.85       0.03       0.54       0.04
##  [1] -155333.87       0.62       0.11       0.24       0.04       0.20
##  [7]       0.10       0.85       0.03       0.55       0.04
##  [1] -155281.81       0.62       0.10       0.24       0.04       0.21
##  [7]       0.11       0.85       0.03       0.56       0.04
##  [1] -155266.11       0.61       0.10       0.24       0.05       0.21
##  [7]       0.11       0.84       0.03       0.56       0.04
##  [1] -155264.73       0.61       0.10       0.24       0.05       0.21
##  [7]       0.11       0.84       0.03       0.56       0.04
## [1] 13
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160493.51       0.60       0.20       0.18       0.02       0.16
##  [7]       0.09       0.86       0.03       0.52       0.05
##  [1] -156901.58       0.64       0.16       0.17       0.03       0.18
##  [7]       0.10       0.84       0.03       0.53       0.04
##  [1] -156246.35       0.66       0.14       0.16       0.04       0.19
##  [7]       0.10       0.83       0.03       0.54       0.04
##  [1] -156042.13       0.66       0.13       0.16       0.04       0.20
##  [7]       0.11       0.82       0.03       0.54       0.04
##  [1] -155991.69       0.66       0.13       0.16       0.05       0.21
##  [7]       0.11       0.82       0.04       0.55       0.04
##  [1] -155998.34       0.65       0.12       0.17       0.06       0.21
##  [7]       0.11       0.81       0.04       0.55       0.04
## [1] 14
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -157985.66       0.55       0.15       0.29       0.02       0.17
##  [7]       0.09       0.88       0.03       0.52       0.05
##  [1] -155298.48       0.57       0.11       0.29       0.02       0.19
##  [7]       0.10       0.87       0.03       0.53       0.05
##  [1] -154875.77       0.58       0.09       0.30       0.03       0.21
##  [7]       0.10       0.86       0.03       0.54       0.04
##  [1] -154731.59       0.58       0.08       0.30       0.03       0.22
##  [7]       0.11       0.86       0.03       0.55       0.04
##  [1] -154675.01       0.58       0.08       0.30       0.04       0.23
##  [7]       0.11       0.86       0.03       0.55       0.04
##  [1] -154653.48       0.58       0.07       0.30       0.04       0.24
##  [7]       0.11       0.85       0.03       0.56       0.04
##  [1] -154646.39       0.58       0.07       0.31       0.05       0.24
##  [7]       0.12       0.85       0.04       0.56       0.04
## [1] 15
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160561.43       0.60       0.20       0.18       0.02       0.16
##  [7]       0.09       0.86       0.03       0.51       0.05
##  [1] -156955.27       0.64       0.17       0.17       0.03       0.18
##  [7]       0.09       0.84       0.03       0.52       0.05
##  [1] -156310.09       0.65       0.15       0.16       0.03       0.20
##  [7]       0.10       0.83       0.04       0.53       0.04
##  [1] -156116.99       0.66       0.14       0.16       0.04       0.21
##  [7]       0.10       0.82       0.04       0.54       0.04
##  [1] -156074.73       0.66       0.13       0.17       0.04       0.21
##  [7]       0.11       0.82       0.04       0.54       0.04
##  [1] -156085.66       0.65       0.13       0.17       0.05       0.22
##  [7]       0.11       0.81       0.04       0.55       0.04
##  [1] -156111.46       0.65       0.13       0.17       0.05       0.22
##  [7]       0.11       0.81       0.04       0.55       0.04
##  [1] -156137.18       0.64       0.13       0.17       0.06       0.22
##  [7]       0.11       0.81       0.04       0.55       0.04
##  [1] -156157.47       0.63       0.13       0.17       0.06       0.22
##  [7]       0.11       0.81       0.04       0.55       0.04
##  [1] -156171.15       0.63       0.13       0.18       0.06       0.22
##  [7]       0.11       0.81       0.04       0.55       0.04
##  [1] -156179.01       0.62       0.13       0.18       0.07       0.23
##  [7]       0.11       0.81       0.04       0.55       0.04
## [1] 16
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -158513.30       0.55       0.18       0.25       0.02       0.16
##  [7]       0.09       0.87       0.03       0.52       0.05
##  [1] -155719.03       0.59       0.15       0.24       0.02       0.17
##  [7]       0.10       0.86       0.03       0.53       0.05
##  [1] -155339.86       0.60       0.13       0.24       0.03       0.18
##  [7]       0.10       0.86       0.03       0.54       0.05
##  [1] -155213.01       0.61       0.12       0.24       0.03       0.19
##  [7]       0.10       0.85       0.03       0.55       0.04
##  [1] -155159.48       0.61       0.11       0.24       0.04       0.19
##  [7]       0.10       0.85       0.03       0.55       0.04
##  [1] -155135.64       0.60       0.11       0.24       0.04       0.20
##  [7]       0.11       0.85       0.03       0.56       0.04
##  [1] -155125.08       0.60       0.11       0.25       0.05       0.20
##  [7]       0.11       0.85       0.03       0.56       0.04
##  [1] -155120.02       0.60       0.11       0.25       0.05       0.20
##  [7]       0.11       0.85       0.03       0.57       0.04
## [1] 17
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -158305.37       0.55       0.16       0.27       0.02       0.16
##  [7]       0.09       0.87       0.03       0.52       0.05
##  [1] -155471.42       0.58       0.12       0.27       0.02       0.18
##  [7]       0.10       0.86       0.03       0.53       0.05
##  [1] -155064.01       0.60       0.11       0.27       0.03       0.20
##  [7]       0.11       0.86       0.03       0.54       0.04
##  [1] -154924.29       0.60       0.10       0.27       0.03       0.21
##  [7]       0.11       0.85       0.03       0.54       0.04
##  [1] -154863.56       0.60       0.09       0.27       0.04       0.22
##  [7]       0.12       0.85       0.03       0.55       0.04
##  [1] -154834.50       0.60       0.09       0.27       0.04       0.22
##  [7]       0.12       0.85       0.03       0.55       0.04
##  [1] -154819.06       0.59       0.08       0.28       0.05       0.23
##  [7]       0.12       0.85       0.03       0.56       0.04
##  [1] -154808.68       0.59       0.08       0.28       0.05       0.23
##  [7]       0.13       0.85       0.03       0.56       0.04
##  [1] -154799.06       0.58       0.08       0.28       0.06       0.24
##  [7]       0.13       0.85       0.03       0.56       0.04
## [1] 18
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -159623.23       0.58       0.17       0.23       0.02       0.17
##  [7]       0.09       0.87       0.03       0.52       0.05
##  [1] -156450.19       0.62       0.13       0.22       0.03       0.19
##  [7]       0.10       0.86       0.03       0.53       0.05
##  [1] -155855.67       0.64       0.11       0.22       0.03       0.21
##  [7]       0.11       0.85       0.03       0.54       0.04
##  [1] -155639.96       0.64       0.10       0.22       0.04       0.22
##  [7]       0.11       0.84       0.04       0.55       0.04
##  [1] -155563.14       0.64       0.10       0.22       0.04       0.23
##  [7]       0.12       0.84       0.04       0.56       0.04
##  [1] -155546.38       0.63       0.09       0.22       0.05       0.24
##  [7]       0.12       0.84       0.04       0.56       0.04
##  [1] -155554.75       0.63       0.09       0.23       0.05       0.25
##  [7]       0.12       0.83       0.04       0.57       0.04
## [1] 19
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -158766.69       0.56       0.16       0.26       0.02       0.17
##  [7]       0.09       0.87       0.03       0.52       0.05
##  [1] -155660.29       0.60       0.12       0.26       0.02       0.19
##  [7]       0.10       0.86       0.03       0.53       0.05
##  [1] -155177.48       0.61       0.10       0.26       0.03       0.21
##  [7]       0.11       0.85       0.03       0.54       0.04
##  [1] -155006.79       0.61       0.09       0.26       0.04       0.22
##  [7]       0.11       0.85       0.03       0.55       0.04
##  [1] -154936.92       0.61       0.09       0.27       0.04       0.23
##  [7]       0.12       0.85       0.03       0.55       0.04
##  [1] -154910.18       0.60       0.08       0.27       0.05       0.24
##  [7]       0.12       0.85       0.03       0.56       0.04
##  [1] -154902.65       0.60       0.08       0.27       0.05       0.25
##  [7]       0.13       0.85       0.03       0.56       0.04
## [1] 20
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160347.69       0.59       0.18       0.21       0.02       0.16
##  [7]       0.10       0.86       0.03       0.52       0.05
##  [1] -156638.86       0.63       0.14       0.20       0.03       0.18
##  [7]       0.10       0.84       0.03       0.53       0.05
##  [1] -155906.57       0.64       0.13       0.21       0.03       0.19
##  [7]       0.11       0.83       0.03       0.54       0.05
##  [1] -155700.05       0.64       0.11       0.21       0.04       0.20
##  [7]       0.11       0.82       0.03       0.55       0.05
##  [1] -155659.56       0.64       0.11       0.21       0.04       0.21
##  [7]       0.12       0.82       0.03       0.55       0.04
##  [1] -155672.32       0.63       0.10       0.22       0.04       0.22
##  [7]       0.12       0.82       0.04       0.56       0.04
##  [1] -155698.02       0.63       0.10       0.22       0.05       0.22
##  [7]       0.12       0.81       0.04       0.56       0.04
##  [1] -155722.63       0.62       0.10       0.22       0.05       0.22
##  [7]       0.13       0.81       0.04       0.56       0.04
##  [1] -155741.70       0.62       0.10       0.23       0.05       0.23
##  [7]       0.13       0.81       0.04       0.56       0.04
##  [1] -155754.60       0.61       0.10       0.23       0.06       0.23
##  [7]       0.13       0.81       0.04       0.56       0.04
##  [1] -155762.12       0.61       0.10       0.23       0.06       0.23
##  [7]       0.13       0.81       0.04       0.56       0.04
## [1] 21
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160298.78       0.59       0.18       0.22       0.02       0.16
##  [7]       0.09       0.86       0.03       0.52       0.05
##  [1] -156358.44       0.62       0.14       0.21       0.03       0.18
##  [7]       0.10       0.85       0.03       0.54       0.05
##  [1] -155618.23       0.63       0.12       0.22       0.03       0.19
##  [7]       0.10       0.83       0.03       0.55       0.04
##  [1] -155404.35       0.63       0.11       0.22       0.04       0.20
##  [7]       0.10       0.83       0.03       0.56       0.04
##  [1] -155364.82       0.63       0.10       0.23       0.04       0.20
##  [7]       0.10       0.82       0.04       0.57       0.04
##  [1] -155386.14       0.62       0.10       0.23       0.05       0.20
##  [7]       0.11       0.82       0.04       0.57       0.04
##  [1] -155424.14       0.61       0.10       0.24       0.05       0.21
##  [7]       0.11       0.82       0.04       0.58       0.04
##  [1] -155461.56       0.61       0.10       0.24       0.06       0.21
##  [7]       0.11       0.81       0.04       0.58       0.03
##  [1] -155492.38       0.60       0.10       0.24       0.06       0.21
##  [7]       0.11       0.81       0.04       0.58       0.03
##  [1] -155515.34       0.59       0.10       0.25       0.06       0.21
##  [7]       0.11       0.81       0.04       0.58       0.03
##  [1] -155531.28       0.59       0.10       0.25       0.07       0.21
##  [7]       0.11       0.81       0.04       0.58       0.03
##  [1] -155541.21       0.58       0.10       0.25       0.07       0.21
##  [7]       0.11       0.81       0.04       0.58       0.03
## [1] 22
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160906.11       0.60       0.21       0.17       0.02       0.16
##  [7]       0.09       0.86       0.04       0.52       0.05
##  [1] -157247.64       0.65       0.18       0.15       0.03       0.18
##  [7]       0.09       0.84       0.04       0.53       0.05
##  [1] -156509.64       0.66       0.16       0.14       0.03       0.19
##  [7]       0.09       0.83       0.04       0.54       0.04
##  [1] -156270.59       0.67       0.15       0.14       0.04       0.19
##  [7]       0.09       0.81       0.04       0.55       0.04
##  [1] -156220.83       0.67       0.14       0.15       0.05       0.20
##  [7]       0.09       0.81       0.04       0.55       0.04
##  [1] -156243.75       0.66       0.14       0.15       0.05       0.20
##  [7]       0.09       0.80       0.05       0.56       0.04
##  [1] -156287.76       0.65       0.14       0.15       0.06       0.20
##  [7]       0.09       0.79       0.05       0.56       0.04
##  [1] -156330.65       0.65       0.14       0.15       0.06       0.20
##  [7]       0.09       0.79       0.05       0.56       0.04
##  [1] -156364.11       0.64       0.14       0.16       0.06       0.20
##  [7]       0.09       0.79       0.05       0.56       0.04
##  [1] -156386.42       0.64       0.14       0.16       0.07       0.20
##  [7]       0.09       0.79       0.05       0.56       0.04
##  [1] -156398.51       0.63       0.14       0.16       0.07       0.20
##  [7]       0.09       0.79       0.05       0.56       0.04
##  [1] -156402.50       0.62       0.14       0.16       0.07       0.20
##  [7]       0.09       0.78       0.05       0.56       0.04
## [1] 23
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160598.48       0.59       0.23       0.15       0.02       0.15
##  [7]       0.09       0.86       0.03       0.52       0.05
##  [1] -156829.70       0.63       0.20       0.13       0.03       0.16
##  [7]       0.09       0.83       0.03       0.53       0.05
##  [1] -156139.69       0.65       0.19       0.13       0.03       0.16
##  [7]       0.09       0.82       0.03       0.54       0.04
##  [1] -155951.36       0.65       0.18       0.13       0.04       0.17
##  [7]       0.09       0.81       0.03       0.55       0.04
##  [1] -155932.23       0.65       0.17       0.14       0.05       0.17
##  [7]       0.09       0.80       0.03       0.55       0.04
##  [1] -155969.62       0.64       0.17       0.14       0.05       0.16
##  [7]       0.09       0.80       0.03       0.55       0.04
##  [1] -156019.01       0.63       0.17       0.14       0.06       0.16
##  [7]       0.09       0.79       0.03       0.55       0.04
##  [1] -156062.89       0.62       0.17       0.14       0.06       0.16
##  [7]       0.09       0.79       0.03       0.56       0.04
##  [1] -156094.85       0.62       0.17       0.15       0.07       0.16
##  [7]       0.09       0.79       0.03       0.56       0.04
##  [1] -156114.03       0.61       0.17       0.15       0.07       0.16
##  [7]       0.08       0.79       0.04       0.56       0.04
##  [1] -156121.68       0.60       0.17       0.15       0.08       0.16
##  [7]       0.08       0.79       0.04       0.56       0.04
## [1] 24
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -157324.85       0.52       0.32       0.14       0.02       0.13
##  [7]       0.07       0.89       0.04       0.50       0.05
##  [1] -155689.72       0.55       0.32       0.11       0.02       0.13
##  [7]       0.07       0.89       0.04       0.50       0.04
##  [1] -155671.43       0.56       0.32       0.09       0.03       0.13
##  [7]       0.06       0.89       0.04       0.50       0.04
##  [1] -155708.53       0.57       0.31       0.08       0.03       0.13
##  [7]       0.06       0.89       0.04       0.49       0.04
##  [1] -155747.70       0.58       0.30       0.08       0.04       0.13
##  [7]       0.06       0.89       0.04       0.49       0.04
##  [1] -155783.45       0.58       0.30       0.07       0.05       0.12
##  [7]       0.05       0.90       0.04       0.49       0.04
##  [1] -155814.94       0.59       0.29       0.07       0.05       0.12
##  [7]       0.05       0.90       0.04       0.49       0.04
##  [1] -155842.40       0.59       0.29       0.07       0.05       0.12
##  [7]       0.05       0.90       0.04       0.48       0.04
##  [1] -155864.93       0.59       0.29       0.07       0.06       0.11
##  [7]       0.05       0.90       0.03       0.48       0.04
##  [1] -155881.96       0.59       0.28       0.06       0.06       0.11
##  [7]       0.04       0.91       0.03       0.48       0.04
##  [1] -155894.36       0.59       0.28       0.06       0.07       0.11
##  [7]       0.04       0.91       0.03       0.47       0.04
##  [1] -155902.73       0.59       0.28       0.06       0.07       0.11
##  [7]       0.04       0.91       0.03       0.47       0.04
## [1] 25
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -160447.86       0.60       0.27       0.11       0.02       0.15
##  [7]       0.08       0.86       0.04       0.51       0.05
##  [1] -157322.18       0.64       0.25       0.08       0.03       0.16
##  [7]       0.08       0.84       0.04       0.52       0.04
##  [1] -156700.27       0.65       0.24       0.07       0.04       0.16
##  [7]       0.08       0.81       0.05       0.53       0.04
##  [1] -156451.79       0.65       0.23       0.07       0.04       0.16
##  [7]       0.08       0.80       0.05       0.53       0.04
##  [1] -156373.45       0.65       0.23       0.07       0.05       0.16
##  [7]       0.08       0.78       0.05       0.54       0.04
##  [1] -156380.40       0.65       0.23       0.07       0.06       0.16
##  [7]       0.08       0.77       0.05       0.54       0.04
## [1] 26
##  [1] "loglik"   "Prior(H)" "Prior(U)" "Prior(M)" "Prior(I)" "Mu(U)"   
##  [7] "Rho(U)"   "MU(M)"    "Rho(M)"   "mu_I"     "rho_I"   
##  [1] "XXX"  "0.41" "0.31" "0.27" "0.01" "0.1"  "0.1"  "0.9"  "0.03" "0.5" 
## [11] "0.05"
##  [1] -159355.88       0.57       0.25       0.15       0.02       0.15
##  [7]       0.08       0.88       0.04       0.51       0.05
##  [1] -157168.48       0.62       0.23       0.12       0.03       0.16
##  [7]       0.08       0.86       0.05       0.52       0.04
##  [1] -156853.78       0.64       0.22       0.11       0.03       0.16
##  [7]       0.08       0.85       0.06       0.52       0.04
##  [1] -156731.38       0.65       0.21       0.10       0.04       0.16
##  [7]       0.08       0.84       0.06       0.52       0.04
##  [1] -156678.48       0.65       0.20       0.10       0.04       0.16
##  [7]       0.08       0.84       0.07       0.53       0.04
##  [1] -156656.20       0.66       0.20       0.10       0.05       0.16
##  [7]       0.08       0.83       0.07       0.53       0.04
##  [1] -156647.03       0.66       0.19       0.10       0.05       0.16
##  [7]       0.08       0.83       0.07       0.53       0.04
plts_paired_order<-plts_paired[order(sampleinfo_organoid_fetal$passage.or.rescope.no_numeric)]

pdf(here("figs","MTAB4957_fetal_organoids_thresholding_all_samples.pdf"))
plts_paired_order
## [[1]]
## 
## [[2]]
## 
## [[3]]
## 
## [[4]]
## 
## [[5]]
## 
## [[6]]
## 
## [[7]]
## 
## [[8]]
## 
## [[9]]
## 
## [[10]]
## 
## [[11]]
## 
## [[12]]
## 
## [[13]]
## 
## [[14]]
## 
## [[15]]
## 
## [[16]]
## 
## [[17]]
## 
## [[18]]
## 
## [[19]]
## 
## [[20]]
## 
## [[21]]
## 
## [[22]]
## 
## [[23]]
## 
## [[24]]
## 
## [[25]]
## 
## [[26]]
dev.off()
## png 
##   2

Differential methylation with passage not fetal

mod<-model.matrix(~ 0 + passage.or.rescope.no_numeric, data=sampleinfo_organoid_notfetal)
fit <- lmFit(MTAB_organoid_beta_notfetal, mod)
ebfit <- eBayes(fit)

# covariate adjusted beta values
beta<-MTAB_organoid_beta_notfetal

passage_db<-sapply(1:nrow(beta), function(x){
  sampleinfo_cpg<-sampleinfo_organoid_notfetal
  sampleinfo_cpg$beta<-as.numeric(beta[x,])
  
  fit<-lm(beta ~ passage.or.rescope.no_numeric, data=sampleinfo_cpg)
  pval<-summary(fit)$coef["passage.or.rescope.no_numeric","Pr(>|t|)"]
  slope<-fit$coefficients[2]
  
  (min(sampleinfo_organoid_notfetal$passage.or.rescope.no_numeric)*slope) - (max(sampleinfo_organoid_notfetal$passage.or.rescope.no_numeric)*slope)})

passage_MTAB<-data.frame(p.value=ebfit$p.value[,"passage.or.rescope.no_numeric"], CpG=rownames(beta), db=passage_db)

# Adjust P values
passage_MTAB$p_adjusted<-p.adjust(passage_MTAB$p.value, method="BH")

diff_CpG_dbMTAB<-passage_MTAB[which(passage_MTAB$p_adjusted<0.05 & abs(passage_MTAB$db)>0.15),] #25086
diff_CpG_db_hypoMTAB<-diff_CpG_dbMTAB$CpG[which((diff_CpG_dbMTAB$db)>=0.15)] #  17419
diff_CpG_db_hyperMTAB<-diff_CpG_dbMTAB$CpG[which((diff_CpG_dbMTAB$db)<=(-0.15))] #  7667

load original organoid passage CpGs

load(here("data","beta_organoids.RData"))
pvals_long<-read.csv(here("data","Heteroskedactiy_pvalues_FDR_1000iter.csv"), header=T)
pvals_long[,1]<-NULL
colnames(pvals_long)<-c("BP_count","diff_count","mean_db","fdr_BP","fdr_diff")
pvals_long$CpG<-rownames(organoid_beta)
pvals_long$BP_pval<-((1000-pvals_long$BP_count)+1)/1001
pvals_long$diff_pval<-((1000-pvals_long$diff_count)+1)/1001
pvals_long$BP_fdr<-((1000-pvals_long$fdr_BP)+1)/1001
pvals_long$diff_fdr<-((1000-pvals_long$fdr_diff)+1)/1001

hetero_CpG<-rownames(organoid_beta)[which(pvals_long$BP_fdr<0.05)]
print(paste("CpGs with significant (adjusted p<0.05) heteroskedactiy: ", length(hetero_CpG), sep=""))
## [1] "CpGs with significant (adjusted p<0.05) heteroskedactiy: 41852"
diff_CpG<-rownames(organoid_beta)[which(pvals_long$diff_fdr<0.05)]
diff_CpG_db<-pvals_long[which(pvals_long$diff_fdr<0.05 & abs(pvals_long$mean_db)>0.15),]
print(paste("CpGs with significant (adjusted p<0.05; delta beta >0.05) differential methylation: ", nrow(diff_CpG_db), sep=""))
## [1] "CpGs with significant (adjusted p<0.05; delta beta >0.05) differential methylation: 23766"
diff_CpG_db_hypo<-diff_CpG_db$CpG[which((diff_CpG_db$mean_db)>=0.15)] #  11772
diff_CpG_db_hyper<-diff_CpG_db$CpG[which((diff_CpG_db$mean_db)<=(-0.15))] #  5214

How many differential CpGs could overlap? 450K vs EPIC

print(paste("Of the ", nrow(diff_CpG_db), " CpGs differential with passage in the original organoids, ",
            length(diff_CpG_db$CpG[which(diff_CpG_db$CpG%in%rownames(MTAB_organoid_beta_notfetal))]), " are in the 450K data", sep=""))
## [1] "Of the 23766 CpGs differential with passage in the original organoids, 7628 are in the 450K data"
diff_CpG_db_hypo_overlap<-diff_CpG_db_hypo[which(diff_CpG_db_hypo%in%rownames(MTAB_organoid_beta_notfetal))]
diff_CpG_db_hyper_overlap<-diff_CpG_db_hyper[which(diff_CpG_db_hyper%in%rownames(MTAB_organoid_beta_notfetal))]

diff_CpG_db_hypoMTAB_overlap<-diff_CpG_db_hypoMTAB[which(diff_CpG_db_hypoMTAB%in%pvals_long$CpG)]
diff_CpG_db_hyperMTAB_overlap<-diff_CpG_db_hyperMTAB[which(diff_CpG_db_hyperMTAB%in%pvals_long$CpG)]

print(paste("Of the ",length(diff_CpG_db_hypo_overlap)," hypo CpGs also on the 450K ",
            length(intersect(diff_CpG_db_hypoMTAB_overlap, diff_CpG_db_hypo_overlap))," are also hypo in the MTAB-4957 cohort (",
            round((length(intersect(diff_CpG_db_hypoMTAB_overlap, diff_CpG_db_hypo_overlap))/length(diff_CpG_db_hypo_overlap))*100,2),"%)",sep=""))
## [1] "Of the 5098 hypo CpGs also on the 450K 3550 are also hypo in the MTAB-4957 cohort (69.64%)"
print(paste("Of the ",length(diff_CpG_db_hyper_overlap)," hyper CpGs also on the 450K ",
            length(intersect(diff_CpG_db_hyperMTAB_overlap, diff_CpG_db_hyper_overlap))," are also hypo in the MTAB-4957 cohort (",
            round((length(intersect(diff_CpG_db_hyperMTAB_overlap, diff_CpG_db_hyper_overlap))/length(diff_CpG_db_hyper_overlap))*100,2),"%)",sep=""))
## [1] "Of the 2530 hyper CpGs also on the 450K 1198 are also hypo in the MTAB-4957 cohort (47.35%)"

delta beta directionality plot

plt_db_direction<-merge(pvals_long[,c(3,6)], passage_MTAB, by="CpG")# 380776

plt_db_direction$sig<-"Not Significant"
plt_db_direction$sig[which(plt_db_direction$CpG%in%c(intersect(diff_CpG_db_hypoMTAB_overlap, diff_CpG_db_hypo_overlap),intersect(diff_CpG_db_hyperMTAB_overlap, diff_CpG_db_hyper_overlap)))]<-"Significant\nIn Both\nCohorts"

ggplot(plt_db_direction, aes(mean_db, db))+geom_point(aes(color=sig, alpha=sig),shape=19)+th+theme_bw()+
  scale_color_manual(values=c("lightgrey", "cornflowerblue"), name="Significant\nWith Passage")+
  scale_alpha_manual(values=c(0.25,1), guide=F)+
  geom_hline(yintercept=c(-0.15,0.15), color="grey60")+geom_vline(xintercept=c(-0.15,0.15), color="grey60")+
  ylim(-0.8,0.8)+xlim(-0.8,0.8)+xlab("Cohort 1\nPassage Delta Beta")+ylab("Cohort 2 Organoid\nPassage Delta Beta")+
  stat_smooth(method="lm", se=F, color="black")
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing missing values (geom_point).

#ggsave(here("figs","MTAB_db_directionality.pdf"), width=5, height=3.75)
ggsave(here("figs/jpeg","MTAB_db_directionality.jpeg"), width=5, height=3.75)
## Warning: Removed 1 rows containing non-finite values (stat_smooth).

## Warning: Removed 1 rows containing missing values (geom_point).
print(paste("Correlation of delta betas between cohorts: ", round(cor(plt_db_direction$db, plt_db_direction$mean_db),2), sep=""))
## [1] "Correlation of delta betas between cohorts: 0.53"

representative CpGs

epic.organoid_minimal<-epic.organoid[,c(2, 14, 17)]
colnames(epic.organoid_minimal)[1]<-"Assay.Name"
epic.organoid_minimal$cohort<-"Cohort 1 Organoids"

sampleinfo_organoid_notfetal_minimal<-sampleinfo_organoid_notfetal[,c(16,22,21)]
sampleinfo_organoid_notfetal_minimal$cohort<-"Cohort 2 Organoids"

sample_info_both<-rbind(sampleinfo_organoid_notfetal_minimal,epic.organoid_minimal)


plt_hetero_MTAB<-function(CpGs, legend, axislab, title){
  betas<-melt(cbind(MTAB_organoid_beta_notfetal[CpGs,],organoid_beta[CpGs,]))
  organoid_plt<-merge(sample_info_both, betas, by.x="Assay.Name",by.y="Var2")
  
  p<-ggplot(organoid_plt, aes(passage.or.rescope.no_numeric,value))+
    geom_line(aes(group=sample_ID),color="lightgrey")+
    stat_smooth(method="lm", color="grey30", size=0.7, se=F)+th+theme_bw()+
    geom_point(aes(fill=as.factor(passage.or.rescope.no_numeric)),shape=21, size=1.25)+
    scale_fill_manual(values=pass_col,name="Passage\nNumber", drop=T)+
    facet_grid(cohort~Var1)+
    ylab("DNAm Beta")+xlab("Passage Number")+ylim(0,1)+
    theme(plot.margin = margin(0.5, 0.15, 0.5, 0.15, "cm"),plot.title = element_text(size=12))+
    xlim(1,16)
  
  if(missing(legend) & missing(axislab) & missing(title)){p}else{
    if(legend=="N" & axislab=="N"){p + theme(legend.position = "none",axis.title.y=element_blank(),
                                             axis.text.y=element_blank(),
                                             axis.ticks.y=element_blank())+ ggtitle(title)}else{
                                               if(legend=="N" & axislab=="Y"){p + theme(legend.position = "none") + ggtitle(title)}}}}

plt_hetero_MTAB(c("cg25402228","cg09146328"))

ggsave(here("figs","Passage_differential_CpGs_MTAB4957.pdf"),width = 4.75, height = 4)
ggsave(here("figs/jpeg","Passage_differential_CpGs_MTAB4957.jpeg"), width = 4.75, height = 4)

Differential methylation with passage fetal

mod<-model.matrix(~ 0 + passage.or.rescope.no_numeric, data=sampleinfo_organoid_fetal)
fit <- lmFit(MTAB_organoid_beta_fetal, mod)
ebfit <- eBayes(fit)

# covariate adjusted beta values
beta<-MTAB_organoid_beta_fetal

passage_db<-sapply(1:nrow(beta), function(x){
  sampleinfo_cpg<-sampleinfo_organoid_fetal
  sampleinfo_cpg$beta<-as.numeric(beta[x,])
  
  fit<-lm(beta ~ passage.or.rescope.no_numeric, data=sampleinfo_cpg)
  pval<-summary(fit)$coef["passage.or.rescope.no_numeric","Pr(>|t|)"]
  slope<-fit$coefficients[2]
  
  (min(sampleinfo_organoid_fetal$passage.or.rescope.no_numeric)*slope) - (max(sampleinfo_organoid_fetal$passage.or.rescope.no_numeric)*slope)})

passage_MTAB<-data.frame(p.value=ebfit$p.value[,"passage.or.rescope.no_numeric"], CpG=rownames(beta), db=passage_db)

# p adjust
passage_MTAB$p_adjusted<-p.adjust(passage_MTAB$p.value, method="BH")

diff_CpG_dbMTAB<-passage_MTAB[which(passage_MTAB$p_adjusted<0.05 & abs(passage_MTAB$db)>0.15),] #58958
diff_CpG_db_hypoMTAB<-diff_CpG_dbMTAB$CpG[which((diff_CpG_dbMTAB$db)>=0.15)] #  45098
diff_CpG_db_hyperMTAB<-diff_CpG_dbMTAB$CpG[which((diff_CpG_dbMTAB$db)<=(-0.15))] #  13860

How many differential CpGs could overlap? 450K vs EPIC

print(paste("Of the ", nrow(diff_CpG_db), " CpGs differential with passage in the original organoids, ",
            length(diff_CpG_db$CpG[which(diff_CpG_db$CpG%in%rownames(MTAB_organoid_beta_fetal))]), " are in the 450K data", sep=""))
## [1] "Of the 23766 CpGs differential with passage in the original organoids, 7628 are in the 450K data"
diff_CpG_db_hypo_overlap<-diff_CpG_db_hypo[which(diff_CpG_db_hypo%in%rownames(MTAB_organoid_beta_fetal))]
diff_CpG_db_hyper_overlap<-diff_CpG_db_hyper[which(diff_CpG_db_hyper%in%rownames(MTAB_organoid_beta_fetal))]

diff_CpG_db_hypoMTAB_overlap<-diff_CpG_db_hypoMTAB[which(diff_CpG_db_hypoMTAB%in%pvals_long$CpG)]
diff_CpG_db_hyperMTAB_overlap<-diff_CpG_db_hyperMTAB[which(diff_CpG_db_hyperMTAB%in%pvals_long$CpG)]

print(paste("Of the ",length(diff_CpG_db_hypo_overlap)," hypo CpGs also on the 450K ",
            length(intersect(diff_CpG_db_hypoMTAB_overlap, diff_CpG_db_hypo_overlap))," are also hypo in the MTAB-4957 cohort (",
            round((length(intersect(diff_CpG_db_hypoMTAB_overlap, diff_CpG_db_hypo_overlap))/length(diff_CpG_db_hypo_overlap))*100,2),"%)",sep=""))
## [1] "Of the 5098 hypo CpGs also on the 450K 3980 are also hypo in the MTAB-4957 cohort (78.07%)"
print(paste("Of the ",length(diff_CpG_db_hyper_overlap)," hyper CpGs also on the 450K ",
            length(intersect(diff_CpG_db_hyperMTAB_overlap, diff_CpG_db_hyper_overlap))," are also hypo in the MTAB-4957 cohort (",
            round((length(intersect(diff_CpG_db_hyperMTAB_overlap, diff_CpG_db_hyper_overlap))/length(diff_CpG_db_hyper_overlap))*100,2),"%)",sep=""))
## [1] "Of the 2530 hyper CpGs also on the 450K 845 are also hypo in the MTAB-4957 cohort (33.4%)"
### delta beta directionality plot
plt_db_direction<-merge(pvals_long[,c(3,6)], passage_MTAB, by="CpG")

plt_db_direction$sig<-"Not Significant"
plt_db_direction$sig[which(plt_db_direction$CpG%in%c(intersect(diff_CpG_db_hypoMTAB_overlap, diff_CpG_db_hypo_overlap),intersect(diff_CpG_db_hyperMTAB_overlap, diff_CpG_db_hyper_overlap)))]<-"Significant\nIn Both\nCohorts"

ggplot(plt_db_direction, aes(mean_db, db))+geom_point(aes(color=sig, alpha=sig),shape=19)+th+theme_bw()+
  scale_color_manual(values=c("lightgrey", "cornflowerblue"), name="Significant\nWith Passage")+
  scale_alpha_manual(values=c(0.25,1), guide=F)+
  geom_hline(yintercept=c(-0.15,0.15), color="grey60")+geom_vline(xintercept=c(-0.15,0.15), color="grey60")+
  ylim(-0.8,0.8)+xlim(-0.8,0.8)+xlab("Cohort 1\nPassage Delta Beta")+ylab("Cohort 2 Fetal Organoid\nPassage Delta Beta")+
  stat_smooth(method="lm", se=F, color="black")
## Warning: Removed 201 rows containing non-finite values (stat_smooth).
## Warning: Removed 201 rows containing missing values (geom_point).

#ggsave(here("figs","MTAB_db_directionality_fetal.pdf"), width=5, height=3.75)
ggsave(here("figs/jpeg","MTAB_db_directionality_fetal.jpeg"), width=5, height=3.75)
## Warning: Removed 201 rows containing non-finite values (stat_smooth).

## Warning: Removed 201 rows containing missing values (geom_point).
print(paste("Correlation of delta betas between cohorts: ", round(cor(plt_db_direction$db, plt_db_direction$mean_db),2), sep=""))
## [1] "Correlation of delta betas between cohorts: 0.5"

representative CpGs

sampleinfo_organoid_fetal_minimal<-sampleinfo_organoid_fetal[,c(16,22,21)]
sampleinfo_organoid_fetal_minimal$cohort<-"Cohort 2 Fetal Organoids"

sample_info_both<-rbind(sampleinfo_organoid_fetal_minimal,epic.organoid_minimal)

plt_hetero_MTAB<-function(CpGs, legend, axislab, title){
  betas<-melt(cbind(MTAB_organoid_beta_fetal[CpGs,],organoid_beta[CpGs,]))
  organoid_plt<-merge(sample_info_both, betas, by.x="Assay.Name",by.y="Var2")
  
  p<-ggplot(organoid_plt, aes(passage.or.rescope.no_numeric,value))+
    geom_line(aes(group=sample_ID),color="lightgrey")+
    stat_smooth(method="lm", color="grey30", size=0.7, se=F)+th+theme_bw()+
    geom_point(aes(fill=as.factor(passage.or.rescope.no_numeric)),shape=21, size=1.25)+
    scale_fill_manual(values=pass_col,name="Passage\nNumber", drop=T)+
    facet_grid(cohort~Var1)+
    ylab("DNAm Beta")+xlab("Passage Number")+ylim(0,1)+
    theme(plot.margin = margin(0.5, 0.15, 0.5, 0.15, "cm"),plot.title = element_text(size=12), legend.key.size = unit(0.4, "cm"))+
    xlim(1,23)
  
  if(missing(legend) & missing(axislab) & missing(title)){p}else{
    if(legend=="N" & axislab=="N"){p + theme(legend.position = "none",axis.title.y=element_blank(),
                                             axis.text.y=element_blank(),
                                             axis.ticks.y=element_blank())+ ggtitle(title)}else{
                                               if(legend=="N" & axislab=="Y"){p + theme(legend.position = "none") + ggtitle(title)}}}}

plt_hetero_MTAB(c("cg25402228","cg09146328"))

ggsave(here("figs","Passage_differential_CpGs_MTAB4957_fetal.pdf"),width = 4.75, height = 4)
ggsave(here("figs/jpeg","Passage_differential_CpGs_MTAB4957_fetal.jpeg"), width = 4.75, height = 4)

R Session Info

sessionInfo()
## R version 3.5.1 (2018-07-02)
## Platform: x86_64-conda_cos6-linux-gnu (64-bit)
## Running under: Red Hat Enterprise Linux
## 
## Matrix products: default
## BLAS/LAPACK: /homes/redgar/anaconda3/envs/org_pass/lib/R/lib/libRblas.so
## 
## locale:
##  [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
##  [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
##  [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
##  [1] splines   stats4    parallel  stats     graphics  grDevices utils    
##  [8] datasets  methods   base     
## 
## other attached packages:
##  [1] IlluminaHumanMethylation450kanno.ilmn12.hg19_0.6.0
##  [2] IlluminaHumanMethylation450kmanifest_0.4.0        
##  [3] VGAM_1.1-1                                        
##  [4] reshape2_1.4.3                                    
##  [5] scales_1.0.0                                      
##  [6] limma_3.38.3                                      
##  [7] binom_1.1-1                                       
##  [8] here_0.1                                          
##  [9] RColorBrewer_1.1-2                                
## [10] gridExtra_2.3                                     
## [11] ggplot2_3.1.0                                     
## [12] reshape_0.8.8                                     
## [13] minfi_1.28.0                                      
## [14] bumphunter_1.24.5                                 
## [15] locfit_1.5-9.1                                    
## [16] iterators_1.0.10                                  
## [17] foreach_1.4.4                                     
## [18] Biostrings_2.50.1                                 
## [19] XVector_0.22.0                                    
## [20] SummarizedExperiment_1.12.0                       
## [21] DelayedArray_0.8.0                                
## [22] BiocParallel_1.16.2                               
## [23] matrixStats_0.54.0                                
## [24] Biobase_2.42.0                                    
## [25] GenomicRanges_1.34.0                              
## [26] GenomeInfoDb_1.18.1                               
## [27] IRanges_2.16.0                                    
## [28] S4Vectors_0.20.1                                  
## [29] BiocGenerics_0.28.0                               
## 
## loaded via a namespace (and not attached):
##  [1] colorspace_1.4-0         siggenes_1.56.0         
##  [3] mclust_5.4.2             rprojroot_1.3-2         
##  [5] base64_2.0               bit64_0.9-7             
##  [7] AnnotationDbi_1.44.0     xml2_1.2.0              
##  [9] codetools_0.2-16         knitr_1.21              
## [11] Rsamtools_1.34.0         annotate_1.60.0         
## [13] HDF5Array_1.10.1         readr_1.3.1             
## [15] compiler_3.5.1           httr_1.4.0              
## [17] backports_1.1.3          assertthat_0.2.0        
## [19] Matrix_1.2-15            lazyeval_0.2.1          
## [21] htmltools_0.3.6          prettyunits_1.0.2       
## [23] tools_3.5.1              gtable_0.2.0            
## [25] glue_1.3.0               GenomeInfoDbData_1.2.0  
## [27] dplyr_0.8.0.1            doRNG_1.7.1             
## [29] Rcpp_1.0.0               multtest_2.38.0         
## [31] preprocessCore_1.44.0    nlme_3.1-137            
## [33] rtracklayer_1.42.2       DelayedMatrixStats_1.4.0
## [35] xfun_0.4                 stringr_1.4.0           
## [37] rngtools_1.3.1           XML_3.98-1.16           
## [39] beanplot_1.2             zlibbioc_1.28.0         
## [41] MASS_7.3-51.1            hms_0.4.2               
## [43] rhdf5_2.26.2             GEOquery_2.50.0         
## [45] yaml_2.2.0               memoise_1.1.0           
## [47] pkgmaker_0.27            biomaRt_2.38.0          
## [49] stringi_1.2.4            RSQLite_2.1.1           
## [51] highr_0.7                genefilter_1.64.0       
## [53] GenomicFeatures_1.34.1   bibtex_0.4.2            
## [55] rlang_0.3.1              pkgconfig_2.0.2         
## [57] bitops_1.0-6             nor1mix_1.2-3           
## [59] evaluate_0.12            lattice_0.20-38         
## [61] purrr_0.2.5              Rhdf5lib_1.4.2          
## [63] labeling_0.3             GenomicAlignments_1.18.0
## [65] bit_1.1-12               tidyselect_0.2.5        
## [67] plyr_1.8.4               magrittr_1.5            
## [69] R6_2.4.0                 DBI_1.0.0               
## [71] pillar_1.4.3             withr_2.1.2             
## [73] survival_2.43-3          RCurl_1.95-4.11         
## [75] tibble_2.0.1             crayon_1.3.4            
## [77] rmarkdown_1.11           progress_1.2.0          
## [79] grid_3.5.1               data.table_1.12.0       
## [81] blob_1.1.1               digest_0.6.18           
## [83] xtable_1.8-2             tidyr_0.8.2             
## [85] illuminaio_0.24.0        openssl_1.1             
## [87] munsell_0.5.0            registry_0.5            
## [89] quadprog_1.5-5